* [PATCH 5/6] ath9k: check for NULL rate when using ieee80211_get_rts_cts_rate()
From: Luis R. Rodriguez @ 2013-10-15 0:42 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez, Rajkumar Manoharan
In-Reply-To: <1381797731-2454-1-git-send-email-mcgrof@do-not-panic.com>
ieee80211_get_rts_cts_rate() can return NULL, so don't rely
on its members when it does return NULL.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
drivers/net/wireless/ath/ath9k/xmit.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 47696d2..b9b0819 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2020,6 +2020,9 @@ static void setup_frame_info(struct ieee80211_hw *hw,
fi->keyix = ATH9K_TXKEYIX_INVALID;
fi->keytype = keytype;
fi->framelen = framelen;
+
+ if (!rate)
+ return;
fi->rtscts_rate = rate->hw_value;
if (short_preamble)
fi->rtscts_rate |= rate->hw_value_short;
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 4/6] ath: add support for proper dynamic regulatory hints
From: Luis R. Rodriguez @ 2013-10-15 0:42 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez
In-Reply-To: <1381797731-2454-1-git-send-email-mcgrof@do-not-panic.com>
This enables support for dynamic user regulatory hints.
This is enabled only when CFG80211_CERTIFICATION_ONUS
is selected. For US and JP this is explicitly disabled
unless the systems are being used for strict controlled
testing.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
drivers/net/wireless/ath/Kconfig | 17 ++++++++
drivers/net/wireless/ath/regd.c | 84 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 101 insertions(+)
diff --git a/drivers/net/wireless/ath/Kconfig b/drivers/net/wireless/ath/Kconfig
index ba81d62..c63d115 100644
--- a/drivers/net/wireless/ath/Kconfig
+++ b/drivers/net/wireless/ath/Kconfig
@@ -25,6 +25,23 @@ config ATH_DEBUG
Say Y, if you want to debug atheros wireless drivers.
Right now only ath9k makes use of this.
+config ATH_REG_DYNAMIC_USER_REG_HINTS
+ bool "Atheros dynamic user regulatory hints"
+ depends on CFG80211_CERTIFICATION_ONUS
+ default n
+ ---help---
+ Say N. This should only be enabled in countries where
+ this feature is explicitly allowed and only on cards that
+ specifically have been tested for this.
+
+config ATH_REG_DYNAMIC_USER_CERT_TESTING
+ bool "Atheros dynamic user regulatory testing"
+ depends on ATH_REG_DYNAMIC_USER_REG_HINTS && CFG80211_CERTIFICATION_ONUS
+ default n
+ ---help---
+ Say N. This should only be enabled on systems
+ undergoing certification testing.
+
source "drivers/net/wireless/ath/ath5k/Kconfig"
source "drivers/net/wireless/ath/ath9k/Kconfig"
source "drivers/net/wireless/ath/carl9170/Kconfig"
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 7222eeb..c00687e 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -392,6 +392,89 @@ static void ath_reg_dyn_country(struct wiphy *wiphy,
reg_initiator_name(request->initiator));
}
+static bool dynamic_country_user_possible(struct ath_regulatory *reg)
+{
+ if (config_enabled(CONFIG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
+ return true;
+
+ switch (reg->country_code) {
+ case CTRY_UNITED_STATES:
+ case CTRY_JAPAN1:
+ case CTRY_JAPAN2:
+ case CTRY_JAPAN3:
+ case CTRY_JAPAN4:
+ case CTRY_JAPAN5:
+ case CTRY_JAPAN6:
+ case CTRY_JAPAN7:
+ case CTRY_JAPAN8:
+ case CTRY_JAPAN9:
+ case CTRY_JAPAN10:
+ case CTRY_JAPAN11:
+ case CTRY_JAPAN12:
+ case CTRY_JAPAN13:
+ case CTRY_JAPAN14:
+ case CTRY_JAPAN15:
+ case CTRY_JAPAN16:
+ case CTRY_JAPAN17:
+ case CTRY_JAPAN18:
+ case CTRY_JAPAN19:
+ case CTRY_JAPAN20:
+ case CTRY_JAPAN21:
+ case CTRY_JAPAN22:
+ case CTRY_JAPAN23:
+ case CTRY_JAPAN24:
+ case CTRY_JAPAN25:
+ case CTRY_JAPAN26:
+ case CTRY_JAPAN27:
+ case CTRY_JAPAN28:
+ case CTRY_JAPAN29:
+ case CTRY_JAPAN30:
+ case CTRY_JAPAN31:
+ case CTRY_JAPAN32:
+ case CTRY_JAPAN33:
+ case CTRY_JAPAN34:
+ case CTRY_JAPAN35:
+ case CTRY_JAPAN36:
+ case CTRY_JAPAN37:
+ case CTRY_JAPAN38:
+ case CTRY_JAPAN39:
+ case CTRY_JAPAN40:
+ case CTRY_JAPAN41:
+ case CTRY_JAPAN42:
+ case CTRY_JAPAN43:
+ case CTRY_JAPAN44:
+ case CTRY_JAPAN45:
+ case CTRY_JAPAN46:
+ case CTRY_JAPAN47:
+ case CTRY_JAPAN48:
+ case CTRY_JAPAN49:
+ case CTRY_JAPAN50:
+ case CTRY_JAPAN51:
+ case CTRY_JAPAN52:
+ case CTRY_JAPAN53:
+ case CTRY_JAPAN54:
+ case CTRY_JAPAN55:
+ case CTRY_JAPAN56:
+ case CTRY_JAPAN57:
+ case CTRY_JAPAN58:
+ case CTRY_JAPAN59:
+ return false;
+ }
+
+ return true;
+}
+
+static void ath_reg_dyn_country_user(struct wiphy *wiphy,
+ struct ath_regulatory *reg,
+ struct regulatory_request *request)
+{
+ if (!config_enabled(CONFIG_ATH_REG_DYNAMIC_USER_REG_HINTS))
+ return;
+ if (!dynamic_country_user_possible(reg))
+ return;
+ ath_reg_dyn_country(wiphy, reg, request);
+}
+
void ath_reg_notifier_apply(struct wiphy *wiphy,
struct regulatory_request *request,
struct ath_regulatory *reg)
@@ -424,6 +507,7 @@ void ath_reg_notifier_apply(struct wiphy *wiphy,
case NL80211_REGDOM_SET_BY_DRIVER:
break;
case NL80211_REGDOM_SET_BY_USER:
+ ath_reg_dyn_country_user(wiphy, reg, request);
break;
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
ath_reg_dyn_country(wiphy, reg, request);
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 3/6] ath: split user and driver reguluatory hint parsing
From: Luis R. Rodriguez @ 2013-10-15 0:42 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez
In-Reply-To: <1381797731-2454-1-git-send-email-mcgrof@do-not-panic.com>
On the regulatory notifier split up the parsing of the
hints coming from drivers or user. We'll treat these
separately.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
drivers/net/wireless/ath/regd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 8373650..7222eeb 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -422,6 +422,7 @@ void ath_reg_notifier_apply(struct wiphy *wiphy,
sizeof(struct ath_regulatory));
break;
case NL80211_REGDOM_SET_BY_DRIVER:
+ break;
case NL80211_REGDOM_SET_BY_USER:
break;
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 2/6] ath: move common dynamic regulatory domain setting to a helper
From: Luis R. Rodriguez @ 2013-10-15 0:42 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez
In-Reply-To: <1381797731-2454-1-git-send-email-mcgrof@do-not-panic.com>
This moves the dynamic regulatory domain selection code into
a helper.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
drivers/net/wireless/ath/regd.c | 55 +++++++++++++++++++++++++++--------------
1 file changed, 37 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 7d077c7..8373650 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -356,14 +356,48 @@ static u16 ath_regd_find_country_by_name(char *alpha2)
return -1;
}
+static int __ath_reg_dyn_country(struct wiphy *wiphy,
+ struct ath_regulatory *reg,
+ struct regulatory_request *request)
+{
+ u16 country_code;
+
+ if (!ath_is_world_regd(reg))
+ return -EINVAL;
+
+ country_code = ath_regd_find_country_by_name(request->alpha2);
+ if (country_code == (u16) -1)
+ return -EINVAL;
+
+ reg->current_rd = COUNTRY_ERD_FLAG;
+ reg->current_rd |= country_code;
+
+ __ath_regd_init(reg);
+
+ ath_reg_apply_world_flags(wiphy, request->initiator, reg);
+
+ return 0;
+}
+
+static void ath_reg_dyn_country(struct wiphy *wiphy,
+ struct ath_regulatory *reg,
+ struct regulatory_request *request)
+{
+ if (__ath_reg_dyn_country(wiphy, reg, request))
+ return;
+
+ printk(KERN_DEBUG "ath: regdomain 0x%0x "
+ "dynamically updated by %s\n",
+ reg->current_rd,
+ reg_initiator_name(request->initiator));
+}
+
void ath_reg_notifier_apply(struct wiphy *wiphy,
struct regulatory_request *request,
struct ath_regulatory *reg)
{
struct ath_common *common = container_of(reg, struct ath_common,
regulatory);
- u16 country_code;
-
/* We always apply this */
ath_reg_apply_radar_flags(wiphy);
@@ -391,22 +425,7 @@ void ath_reg_notifier_apply(struct wiphy *wiphy,
case NL80211_REGDOM_SET_BY_USER:
break;
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
- if (!ath_is_world_regd(reg))
- break;
-
- country_code = ath_regd_find_country_by_name(request->alpha2);
- if (country_code == (u16) -1)
- break;
-
- reg->current_rd = COUNTRY_ERD_FLAG;
- reg->current_rd |= country_code;
-
- printk(KERN_DEBUG "ath: regdomain 0x%0x updated by CountryIE\n",
- reg->current_rd);
- __ath_regd_init(reg);
-
- ath_reg_apply_world_flags(wiphy, request->initiator, reg);
-
+ ath_reg_dyn_country(wiphy, reg, request);
break;
}
}
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 1/6] cfg80211: export reg_initiator_name()
From: Luis R. Rodriguez @ 2013-10-15 0:42 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez
In-Reply-To: <1381797731-2454-1-git-send-email-mcgrof@do-not-panic.com>
Drivers can now use this to parse the regulatory request and
be more verbose when needed.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
include/net/cfg80211.h | 9 +++++++++
net/wireless/reg.c | 27 +++++++++++++++++----------
2 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 45f6bf5..419202c 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3483,6 +3483,15 @@ void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy,
u32 center_freq);
+/**
+ * reg_initiator_name - map regulatory request initiator enum to name
+ * @initiator: the regulatory request initiator
+ *
+ * You can use this to map the regulatory request initiator enum to a
+ * proper string representation.
+ */
+const char *reg_initiator_name(enum nl80211_reg_initiator initiator);
+
/*
* callbacks for asynchronous cfg80211 methods, notification
* functions and BSS handling helpers
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index edb2ba4e..9851a2b 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -768,23 +768,25 @@ const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy,
}
EXPORT_SYMBOL(freq_reg_info);
-#ifdef CONFIG_CFG80211_REG_DEBUG
-static const char *reg_initiator_name(enum nl80211_reg_initiator initiator)
+const char *reg_initiator_name(enum nl80211_reg_initiator initiator)
{
switch (initiator) {
case NL80211_REGDOM_SET_BY_CORE:
- return "Set by core";
+ return "core";
case NL80211_REGDOM_SET_BY_USER:
- return "Set by user";
+ return "user";
case NL80211_REGDOM_SET_BY_DRIVER:
- return "Set by driver";
+ return "driver";
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
- return "Set by country IE";
+ return "country IE";
default:
WARN_ON(1);
- return "Set by bug";
+ return "bug";
}
}
+EXPORT_SYMBOL(reg_initiator_name);
+
+#ifdef CONFIG_CFG80211_REG_DEBUG
static void chan_reg_rule_print_dbg(struct ieee80211_channel *chan,
const struct ieee80211_reg_rule *reg_rule)
@@ -986,14 +988,17 @@ static bool ignore_reg_update(struct wiphy *wiphy,
struct regulatory_request *lr = get_last_request();
if (!lr) {
- REG_DBG_PRINT("Ignoring regulatory request %s since last_request is not set\n",
+ REG_DBG_PRINT("Ignoring regulatory request set by %s "
+ "since last_request is not set\n",
reg_initiator_name(initiator));
return true;
}
if (initiator == NL80211_REGDOM_SET_BY_CORE &&
wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) {
- REG_DBG_PRINT("Ignoring regulatory request %s since the driver uses its own custom regulatory domain\n",
+ REG_DBG_PRINT("Ignoring regulatory request set by %s "
+ "since the driver uses its own custom "
+ "regulatory domain\n",
reg_initiator_name(initiator));
return true;
}
@@ -1005,7 +1010,9 @@ static bool ignore_reg_update(struct wiphy *wiphy,
if (wiphy_strict_alpha2_regd(wiphy) && !wiphy->regd &&
initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
!is_world_regdom(lr->alpha2)) {
- REG_DBG_PRINT("Ignoring regulatory request %s since the driver requires its own regulatory domain to be set first\n",
+ REG_DBG_PRINT("Ignoring regulatory request set by %s "
+ "since the driver requires its own regulatory "
+ "domain to be set first\n",
reg_initiator_name(initiator));
return true;
}
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 0/6] ath / ath9k updates
From: Luis R. Rodriguez @ 2013-10-15 0:42 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez
John, Johannes,
here are a few ath / ath9k updates. The dynamic regulatory domain setting
feature requires the cfg80211 reg_initiator_name() patch applied so not
sure how you want to deal with this dependency. Should John just merged
that change?
Luis R. Rodriguez (6):
cfg80211: export reg_initiator_name()
ath: move common dynamic regulatory domain setting to a helper
ath: split user and driver reguluatory hint parsing
ath: add support for proper dynamic regulatory hints
ath9k: check for NULL rate when using ieee80211_get_rts_cts_rate()
ath9k: add TX99 support
drivers/net/wireless/ath/Kconfig | 17 +++
drivers/net/wireless/ath/ath9k/Kconfig | 20 ++++
drivers/net/wireless/ath/ath9k/ar9002_phy.c | 22 ++++
drivers/net/wireless/ath/ath9k/ar9003_phy.c | 95 +++++++++++++++++
drivers/net/wireless/ath/ath9k/ath9k.h | 10 ++
drivers/net/wireless/ath/ath9k/debug.c | 118 ++++++++++++++++++++
drivers/net/wireless/ath/ath9k/hw-ops.h | 16 +++
drivers/net/wireless/ath/ath9k/hw.h | 4 +
drivers/net/wireless/ath/ath9k/init.c | 26 ++---
drivers/net/wireless/ath/ath9k/link.c | 12 ++-
drivers/net/wireless/ath/ath9k/main.c | 160 +++++++++++++++++++++++++++-
drivers/net/wireless/ath/ath9k/recv.c | 3 +
drivers/net/wireless/ath/ath9k/xmit.c | 56 +++++++++-
drivers/net/wireless/ath/regd.c | 140 ++++++++++++++++++++----
include/net/cfg80211.h | 9 ++
net/wireless/reg.c | 27 +++--
16 files changed, 690 insertions(+), 45 deletions(-)
--
1.8.4.rc3
^ permalink raw reply
* pull request: bluetooth-next 2013-10-14
From: Gustavo Padovan @ 2013-10-14 23:52 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, linux-bluetooth, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 12473 bytes --]
Hi John,
More patches for 3.12, busy times for Bluetooth. More than a 100 commits since
the last pull. The bulk of work comes from Johan and Marcel, they are doing
fixes and improvements all over the Bluetooth subsystem, as the diffstat can
show.
Please pull or let me know of any problems! Thanks.
Gustavo
--
The following changes since commit 4f3e219d95a3c31b916dcd5e2631c4e440736f79:
Bluetooth: Only one command per L2CAP LE signalling is supported (2013-10-03 16:09:59 +0300)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next for-upstream
for you to fetch changes up to 4b836f393bd8ed111857a6ee1865e44627266ec6:
Bluetooth: Read current IAC LAP on controller setup (2013-10-14 19:31:18 -0300)
----------------------------------------------------------------
Andre Guedes (4):
Bluetooth: Rename hci_conn variable in hci_connect_le()
Bluetooth: Initialize hci_conn fields in hci_connect_le
Bluetooth: Use HCI request for LE connection
Bluetooth: Refactor hci_connect_le
Johan Hedberg (17):
Bluetooth: Rename HCI_LE_PERIPHERAL to HCI_ADVERTISING
Bluetooth: Add public mgmt function to send New Settings event
Bluetooth: Fix re-enabling advertising after a connection
Bluetooth: Fix changing advertising setting while LE is connected
Bluetooth: Fix potential double-frees of L2CAP skbs
Bluetooth: Fix checking for HCI_SETUP flag when receiving mgmt commands
Bluetooth: Reorganize set_connectable HCI command sending
Bluetooth: Move more logic into set_connectable complete callback
Bluetooth: Add missing error handling for Set Connectable
Bluetooth: Move static advertising functions to avoid forward declarations
Bluetooth: Fix updating advertising data needlessly
Bluetooth: Make Set Connectable also update the LE advertising type
Bluetooth: Move set_bredr_scan() to avoid forward declaration
Bluetooth: Fix updating scan mode in set_bredr()
Bluetooth: Convert Set Discoverable to use an asynchronous request
Bluetooth: Reject invalid bdaddr types for sockets
Bluetooth: Check that bind() bdaddr type matches connect()
Johannes Berg (1):
Bluetooth: Fix variable shadow warnings
Marcel Holtmann (117):
Bluetooth: Fix controller list for AMP discover response
Bluetooth: Remove useless external function to count controllers
Bluetooth: Add constants for AMP controller type
Bluetooth: Separate AMP controller type from HCI device type
Bluetooth: Use explicit AMP controller id value for BR/EDR
Bluetooth: Rename AMP status constants and use them
Bluetooth: Remove pointless inline function
Bluetooth: Remove check for number of AMP controller
Bluetooth: Move hci_amp_capable() function into L2CAP core
Bluetooth: Simplify check if L2CAP connection is AMP capable
Bluetooth: Check for non BR/EDR controller in AMP discover response
Bluetooth: Reject enabling controllers without valid addresses
Bluetooth: Use explicit check for BR/EDR device type
Bluetooth: Simplify device type check for AMP discover response
Bluetooth: Use random address if public address is not available
Bluetooth: Add HCI structure for LE advertising parameters command
Bluetooth: Make it clear that disabling LE disables advertising
Bluetooth: Use helper functions for enabling/disabling advertising
Bluetooth: Add constants for LE advertising types
Bluetooth: Set LE advertising parameters before enabling it
Bluetooth: Use helper function for re-enabling advertising
Bluetooth: Remove no longer needed mgmt_new_settings() function
Bluetooth: Remove mgmt_valid_hdev() helper function
Bluetooth: Send new settings only when pairable changes
Bluetooth: Make mgmt_index_added() and mgmt_index_removed() return void
Bluetooth: Make mgmt_set_powered_failed() return void
Bluetooth: Make mgmt_disconnect_failed() return void
Bluetooth: Make mgmt_connect_failed() return void
Bluetooth: Make mgmt_device_connected() return void
Bluetooth: Make mgmt_device_disconnected() return void
Bluetooth: Make mgmt_device_found() return void
Bluetooth: Make mgmt_remote_name() return void
Bluetooth: Make mgmt_discovering() return void
Bluetooth: Power off AMP controllers after setup phase
Bluetooth: Make mgmt power down notification for BR/EDR explicit
Bluetooth: List powered down AMP controllers correctly
Bluetooth: Read supported features and commands on AMP controllers
Bluetooth: Read location data on AMP controller init
Bluetooth: Read flow control mode on AMP controller init
Bluetooth: Remove unneeded val variable when setting SSP
Bluetooth: Restrict high speed support to SSP enabled controllers
Bluetooth: Fix too long line with set_advertising() function
Bluetooth: Use hci_conn_num() for checking number of LE connections
Bluetooth: Use hci_conn_num() instead of direct connection hash access
Bluetooth: AMP contollers do not support the legacy ioctls
Bluetooth: Remove unused bfusb_ioctl() callback
Bluetooth: Remove unused bluecard_hci_ioctl() callback
Bluetooth: Remove unused bt3c_hci_ioctl() callback
Bluetooth: Remove unused btuart_hci_ioctl() callback
Bluetooth: Remove unused dtl1_hci_ioctl() callback
Bluetooth: Remove unused btmrvl_ioctl() callback
Bluetooth: Remove hdev->ioctl driver callback
Bluetooth: Move amp.h header file into net/bluetooth/
Bluetooth: Move a2mp.h header file into net/bluetooth/
Bluetooth: Move smp.h header file into net/bluetooth/
Bluetooth: Move skb->dev assignment for hdev->send into central place
Bluetooth: Remove pointless check of hci_send_frame parameter
Bluetooth: Remove return value from hci_send_frame() function
Bluetooth: Remove unused h4_check_data_len() function
Bluetooth: Provide hdev parameter to hci_recv_frame() driver callback
Bluetooth: Add hdev parameter to hdev->send driver callback
Bluetooth: Remove pointless parameter check in bfusb_send_frame()
Bluetooth: Remove pointless parameter check in bluecard_hci_send_frame()
Bluetooth: Remove pointless parameter check in bt3c_hci_send_frame()
Bluetooth: Remove pointless parameter check in btmrvl_send_frame()
Bluetooth: Remove pointless parameter check in btuart_hci_send_frame()
Bluetooth: Remove pointless parameter check in dtl1_hci_send_frame()
Bluetooth: Remove pointless parameter check in hci_uart_send_frame()
Bluetooth: Remove pointless parameter check in vhci_send_frame()
Bluetooth: Declare btusb_table[] and blacklist_table[] as const
Bluetooth: Declare bfusb_table[] as const
Bluetooth: Declare bpa10x_table[] as const
Bluetooth: Declare ath3k_table[] and ath3k_blist_tbl[] as const
Bluetooth: Make LE scan interval and window a controller option
Bluetooth: Add management command for setting LE scan parameters
Bluetooth: Fix endless loop with HCI_QUIRK_RESET_ON_CLOSE
Bluetooth: Don't advertise high speed support without SSP
Bluetooth: Add MGMT_OP_SET_SCAN_PARAMS to supported commands list
Bluetooth: Fix HCI init for 1st generation BlueFRITZ! devices
Bluetooth: Fix PSM value for L2CAP connectionless data packets
Bluetooth: Limit security mode 4 level 0 to connection oriented channels
Bluetooth: Allow 3D profile to use security mode 4 level 0
Bluetooth: The L2CAP fixed channel connectionless data is supported
Bluetooth: Unicast connectionless data reception is supported
Bluetooth: Remove l2cap_conn->dst usage from AMP manager
Bluetooth: Remove l2cap_conn->src and l2cap_conn->dst usage from SMP
Bluetooth: Remove l2cap_conn->src and l2cap_conn->dst usage from L2CAP
Bluetooth: Remove l2cap_conn->src and l2cap_conn->dst pointers
Bluetooth: Remove pointless bdaddr_to_le() helper function
Bluetooth: Store the source address type of LE connections
Bluetooth: Store source address of HCI connections
Bluetooth: Update source address and type for incoming LE connections
Bluetooth: Use hci_conn->src address for SMP functions
Bluetooth: Use hci_conn->src address for L2CAP functions
Bluetooth: Fix input address type for SMP C1 function
Bluetooth: Fix coding style violations in SMP handling
Bluetooth: Update L2CAP socket source address from HCI connection
Bluetooth: Store address information in L2CAP channel structure
Bluetooth: Return the correct address type for L2CAP sockets
Bluetooth: Access RFCOMM session addresses through L2CAP channel
Bluetooth: Access CMTP session addresses through L2CAP channel
Bluetooth: Access HIDP session addresses through L2CAP channel
Bluetooth: Access BNEP session addresses through L2CAP channel
Bluetooth: Use SCO addresses from HCI connection directly
Bluetooth: Store SCO address information in its own socket structure
Bluetooth: Store RFCOMM address information in its own socket structure
Bluetooth: Remove src and dst fields from bt_sock structure
Bluetooth: Use l2cap_pi(sk) directly where possible
Bluetooth: Add support for per socket msg_name callback
Bluetooth: Provide msg_name callback for L2CAP connectionless channels
Bluetooth: Increase minor version of core module
Bluetooth: Adjust header for proc socket information
Bluetooth: Introduce L2CAP channel flag for defer setup
Bluetooth: Introduce L2CAP channel callback for resuming
Bluetooth: Check that scan window is smaller or equal than scan interval
Bluetooth: Read number of supported IAC on controller setup
Bluetooth: Read current IAC LAP on controller setup
drivers/bluetooth/ath3k.c | 4 +-
drivers/bluetooth/bfusb.c | 31 +--
drivers/bluetooth/bluecard_cs.c | 30 +--
drivers/bluetooth/bpa10x.c | 11 +-
drivers/bluetooth/bt3c_cs.c | 30 +--
drivers/bluetooth/btmrvl_main.c | 26 +-
drivers/bluetooth/btmrvl_sdio.c | 8 +-
drivers/bluetooth/btsdio.c | 6 +-
drivers/bluetooth/btuart_cs.c | 30 +--
drivers/bluetooth/btusb.c | 21 +-
drivers/bluetooth/btwilink.c | 9 +-
drivers/bluetooth/dtl1_cs.c | 30 +--
drivers/bluetooth/hci_bcsp.c | 5 +-
drivers/bluetooth/hci_h4.c | 24 --
drivers/bluetooth/hci_h5.c | 2 +-
drivers/bluetooth/hci_ldisc.c | 12 +-
drivers/bluetooth/hci_ll.c | 14 +-
drivers/bluetooth/hci_vhci.c | 15 +-
include/net/bluetooth/bluetooth.h | 5 +-
include/net/bluetooth/hci.h | 49 +++-
include/net/bluetooth/hci_core.h | 79 ++-----
include/net/bluetooth/l2cap.h | 14 +-
include/net/bluetooth/mgmt.h | 7 +
include/net/bluetooth/rfcomm.h | 2 +
include/net/bluetooth/sco.h | 5 +-
net/bluetooth/a2mp.c | 63 ++---
{include/net => net}/bluetooth/a2mp.h | 0
net/bluetooth/af_bluetooth.c | 23 +-
net/bluetooth/amp.c | 10 +-
{include/net => net}/bluetooth/amp.h | 0
net/bluetooth/bnep/core.c | 18 +-
net/bluetooth/cmtp/core.c | 6 +-
net/bluetooth/hci_conn.c | 156 ++++++++----
net/bluetooth/hci_core.c | 156 +++++++-----
net/bluetooth/hci_event.c | 103 ++++----
net/bluetooth/hci_sock.c | 10 +-
net/bluetooth/hidp/core.c | 18 +-
net/bluetooth/l2cap_core.c | 221 ++++++++++-------
net/bluetooth/l2cap_sock.c | 86 +++++--
net/bluetooth/mgmt.c | 550 ++++++++++++++++++++++++++++++-------------
net/bluetooth/rfcomm/core.c | 19 +-
net/bluetooth/rfcomm/sock.c | 28 ++-
net/bluetooth/sco.c | 44 ++--
net/bluetooth/smp.c | 81 ++++---
{include/net => net}/bluetooth/smp.h | 0
45 files changed, 1192 insertions(+), 869 deletions(-)
rename {include/net => net}/bluetooth/a2mp.h (100%)
rename {include/net => net}/bluetooth/amp.h (100%)
rename {include/net => net}/bluetooth/smp.h (100%)
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH 2/2] mac80211: store the channel in wdev upon ibss_join
From: Antonio Quartulli @ 2013-10-14 22:38 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Antonio Quartulli
In-Reply-To: <1381790282-1146-1-git-send-email-antonio@meshcoding.com>
From: Antonio Quartulli <antonio@open-mesh.com>
To allow cfg80211 to use the real channel to pick up the
proper (i)bss object, store the used channel in
wdev->channel during ibss_join
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
net/mac80211/ibss.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index a12afe7..2b5aa4b 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -331,6 +331,12 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
bss = cfg80211_inform_bss_width_frame(local->hw.wiphy, chan,
scan_width, mgmt,
presp->head_len, 0, GFP_KERNEL);
+
+ /* store the channel so that it can be used by cfg80211 to retrieve the
+ * correct bss object
+ */
+ sdata->wdev.channel = chan;
+
cfg80211_put_bss(local->hw.wiphy, bss);
netif_carrier_on(sdata->dev);
cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
--
1.8.3.2
^ permalink raw reply related
* [PATCH 1/2] cfg80211: on ibss_joined use the channel to get the proper bss object
From: Antonio Quartulli @ 2013-10-14 22:38 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Antonio Quartulli
From: Antonio Quartulli <antonio@open-mesh.com>
It may be the case that the same IBSS (same bssid and essid)
exists on two different channels (i.e. two IBSSes created
with different but fixed freq) and therefore the latter must
be also used to distinguish them.
Fix wdev->current_bss assignment by passing the channel to
cfg80211_get_bss() on ibss_joined.
This ensures that cfg80211_get_bss() picks up the proper bss
object.
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
net/wireless/ibss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index 403fe29..12c878b 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -28,7 +28,7 @@ void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid)
if (!wdev->ssid_len)
return;
- bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid,
+ bss = cfg80211_get_bss(wdev->wiphy, wdev->channel, bssid,
wdev->ssid, wdev->ssid_len,
WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
--
1.8.3.2
^ permalink raw reply related
* [PATCH] libertas: move firmware lifetime handling to firmware.c
From: Dan Williams @ 2013-10-14 22:51 UTC (permalink / raw)
To: Dr. H. Nikolaus Schaller
Cc: libertas-dev, NeilBrown Brown, netdev, linux-wireless, Harro Haan,
John W. Linville, Belisko Marek, LKML
In-Reply-To: <47ACD120-9393-41EA-BF8A-4E5E316A0C79@goldelico.com>
Previously, each bus type was responsible for freeing the firmware
structure, but some did that badly. Move responsibility for freeing
firmware into firmware.c so that it's done once and correctly, instead
of happening in multiple places in bus-specific code.
This fixes a use-after-free bug found by Dr. H. Nikolaus Schaller where
the SDIO code forgot to NULL priv->helper_fw after freeing it.
Signed-off-by: Dan Williams <dcbw@redhat.com>
---
Tested firmware loading on USB (8388), CS (8385), and SDIO (8686).
diff --git a/drivers/net/wireless/libertas/firmware.c b/drivers/net/wireless/libertas/firmware.c
index c0f9e7e..51b92b5 100644
--- a/drivers/net/wireless/libertas/firmware.c
+++ b/drivers/net/wireless/libertas/firmware.c
@@ -49,14 +49,19 @@ static void main_firmware_cb(const struct firmware *firmware, void *context)
/* Failed to find firmware: try next table entry */
load_next_firmware_from_table(priv);
return;
}
/* Firmware found! */
lbs_fw_loaded(priv, 0, priv->helper_fw, firmware);
+ if (priv->helper_fw) {
+ release_firmware (priv->helper_fw);
+ priv->helper_fw = NULL;
+ }
+ release_firmware (firmware);
}
static void helper_firmware_cb(const struct firmware *firmware, void *context)
{
struct lbs_private *priv = context;
if (!firmware) {
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index c94dd68..ef8c98e 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -750,22 +750,22 @@ static void if_cs_prog_firmware(struct lbs_private *priv, int ret,
}
/* Load the firmware */
ret = if_cs_prog_helper(card, helper);
if (ret == 0 && (card->model != MODEL_8305))
ret = if_cs_prog_real(card, mainfw);
if (ret)
- goto out;
+ return;
/* Now actually get the IRQ */
ret = request_irq(card->p_dev->irq, if_cs_interrupt,
IRQF_SHARED, DRV_NAME, card);
if (ret) {
pr_err("error in request_irq\n");
- goto out;
+ return;
}
/*
* Clear any interrupt cause that happened while sending
* firmware/initializing card
*/
if_cs_write16(card, IF_CS_CARD_INT_CAUSE, IF_CS_BIT_MASK);
@@ -773,18 +773,14 @@ static void if_cs_prog_firmware(struct lbs_private *priv, int ret,
/* And finally bring the card up */
priv->fw_ready = 1;
if (lbs_start_card(priv) != 0) {
pr_err("could not activate card\n");
free_irq(card->p_dev->irq, card);
}
-
-out:
- release_firmware(helper);
- release_firmware(mainfw);
}
/********************************************************************/
/* Callback functions for libertas.ko */
/********************************************************************/
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 4557833..991238a 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -704,28 +704,24 @@ static void if_sdio_do_prog_firmware(struct lbs_private *priv, int ret,
if (ret) {
pr_err("failed to find firmware (%d)\n", ret);
return;
}
ret = if_sdio_prog_helper(card, helper);
if (ret)
- goto out;
+ return;
lbs_deb_sdio("Helper firmware loaded\n");
ret = if_sdio_prog_real(card, mainfw);
if (ret)
- goto out;
+ return;
lbs_deb_sdio("Firmware loaded\n");
if_sdio_finish_power_on(card);
-
-out:
- release_firmware(helper);
- release_firmware(mainfw);
}
static int if_sdio_prog_firmware(struct if_sdio_card *card)
{
int ret;
u16 scratch;
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 4bb6574..87ff0ca 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -1090,19 +1090,15 @@ static int if_spi_init_card(struct if_spi_card *card)
}
err = spu_set_interrupt_mode(card, 0, 1);
if (err)
goto out;
out:
- release_firmware(helper);
- release_firmware(mainfw);
-
lbs_deb_leave_args(LBS_DEB_SPI, "err %d\n", err);
-
return err;
}
static void if_spi_resume_worker(struct work_struct *work)
{
struct if_spi_card *card;
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 2798077..dff08a2 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -840,15 +840,15 @@ static void if_usb_prog_firmware(struct lbs_private *priv, int ret,
pr_err("failed to find firmware (%d)\n", ret);
goto done;
}
cardp->fw = fw;
if (check_fwfile_format(cardp->fw->data, cardp->fw->size)) {
ret = -EINVAL;
- goto release_fw;
+ goto done;
}
/* Cancel any pending usb business */
usb_kill_urb(cardp->rx_urb);
usb_kill_urb(cardp->tx_urb);
cardp->fwlastblksent = 0;
@@ -857,15 +857,15 @@ static void if_usb_prog_firmware(struct lbs_private *priv, int ret,
cardp->fwfinalblk = 0;
cardp->bootcmdresp = 0;
restart:
if (if_usb_submit_rx_urb_fwload(cardp) < 0) {
lbs_deb_usbd(&cardp->udev->dev, "URB submission is failed\n");
ret = -EIO;
- goto release_fw;
+ goto done;
}
cardp->bootcmdresp = 0;
do {
int j = 0;
i++;
if_usb_issue_boot_command(cardp, BOOT_CMD_FW_BY_USB);
@@ -879,22 +879,22 @@ restart:
if (cardp->bootcmdresp == BOOT_CMD_RESP_NOT_SUPPORTED) {
/* Return to normal operation */
ret = -EOPNOTSUPP;
usb_kill_urb(cardp->rx_urb);
usb_kill_urb(cardp->tx_urb);
if (if_usb_submit_rx_urb(cardp) < 0)
ret = -EIO;
- goto release_fw;
+ goto done;
} else if (cardp->bootcmdresp <= 0) {
if (--reset_count >= 0) {
if_usb_reset_device(cardp);
goto restart;
}
ret = -EIO;
- goto release_fw;
+ goto done;
}
i = 0;
cardp->totalbytes = 0;
cardp->fwlastblksent = 0;
cardp->CRC_OK = 1;
@@ -917,37 +917,34 @@ restart:
if (--reset_count >= 0) {
if_usb_reset_device(cardp);
goto restart;
}
pr_info("FW download failure, time = %d ms\n", i * 100);
ret = -EIO;
- goto release_fw;
+ goto done;
}
cardp->priv->fw_ready = 1;
if_usb_submit_rx_urb(cardp);
if (lbs_start_card(priv))
- goto release_fw;
+ goto done;
if_usb_setup_firmware(priv);
/*
* EHS_REMOVE_WAKEUP is not supported on all versions of the firmware.
*/
priv->wol_criteria = EHS_REMOVE_WAKEUP;
if (lbs_host_sleep_cfg(priv, priv->wol_criteria, NULL))
priv->ehs_remove_supported = false;
- release_fw:
- release_firmware(cardp->fw);
- cardp->fw = NULL;
-
done:
+ cardp->fw = NULL;
lbs_deb_leave(LBS_DEB_USB);
}
#ifdef CONFIG_PM
static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
{
^ permalink raw reply related
* Re: [PATCH 3.12] ath5k: fix regression in tx status processing
From: Thomas Hühn @ 2013-10-14 20:16 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, linville, bvahl, ben
In-Reply-To: <1381778328-7684-1-git-send-email-nbd@openwrt.org>
On 14.10.2013, at 21:18, Felix Fietkau <nbd@openwrt.org> wrote:
> The regression was introduced in the following commit:
>
> 0967e01e8e713ed2982fb4eba8ba13794e9a6e89
> "ath5k: make use of the new rate control API"
>
> ath5k_tx_frame_completed saves the intended per-rate retry counts before
> they are cleared by ieee80211_tx_info_clear_status, however at this
> point the information in info->status.rates is incomplete.
>
> This causes significant throughput degradation and excessive packet loss
> on links where high bit rates don't work properly.
>
> Move the copy from bf->rates a few lines up to ensure that the saved
> retry counts are updated, and that they are really cleared in
> info->status.rates after the call to ieee80211_tx_info_clear_status.
>
> Cc: stable@vger.kernel.org # 3.10+
> Cc: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
> Cc: Benjamin Vahl <bvahl@net.t-labs.tu-berlin.de>
> Reported-by: Ben West <ben@gowasabi.net>
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Good catch !
Acked-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
> ---
> drivers/net/wireless/ath/ath5k/base.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index 48161ed..69f58b0 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -1663,15 +1663,15 @@ ath5k_tx_frame_completed(struct ath5k_hw *ah, struct sk_buff *skb,
> ah->stats.tx_bytes_count += skb->len;
> info = IEEE80211_SKB_CB(skb);
>
> + size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates));
> + memcpy(info->status.rates, bf->rates, size);
> +
> tries[0] = info->status.rates[0].count;
> tries[1] = info->status.rates[1].count;
> tries[2] = info->status.rates[2].count;
>
> ieee80211_tx_info_clear_status(info);
>
> - size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates));
> - memcpy(info->status.rates, bf->rates, size);
> -
> for (i = 0; i < ts->ts_final_idx; i++) {
> struct ieee80211_tx_rate *r =
> &info->status.rates[i];
> --
> 1.8.0.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 1/3] rt2x00: rt2800lib: use {tx,rx}_chain_num to avoid superfluous EEPROM access
From: Gabor Juhos @ 2013-10-14 19:59 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
The {rx,tx}_chain_num fields of rt2x00dev->default_ant
contains the number of RX and TX chains already when the
rt2800_probe_hw_mode() function runs. Use those values
instead of parsing the EEPROM configuration values again.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index aa87894..3ca0d3e 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -7450,7 +7450,6 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
char *default_power2;
char *default_power3;
unsigned int i;
- u16 eeprom;
u32 reg;
/*
@@ -7499,8 +7498,6 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
rt2x00dev->hw->max_report_rates = 7;
rt2x00dev->hw->max_rate_tries = 1;
- rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF0, &eeprom);
-
/*
* Initialize hw_mode information.
*/
@@ -7566,22 +7563,21 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
IEEE80211_HT_CAP_SGI_20 |
IEEE80211_HT_CAP_SGI_40;
- if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_TXPATH) >= 2)
+ if (rt2x00dev->default_ant.tx_chain_num >= 2)
spec->ht.cap |= IEEE80211_HT_CAP_TX_STBC;
- spec->ht.cap |=
- rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RXPATH) <<
- IEEE80211_HT_CAP_RX_STBC_SHIFT;
+ spec->ht.cap |= rt2x00dev->default_ant.rx_chain_num <<
+ IEEE80211_HT_CAP_RX_STBC_SHIFT;
spec->ht.ampdu_factor = 3;
spec->ht.ampdu_density = 4;
spec->ht.mcs.tx_params =
IEEE80211_HT_MCS_TX_DEFINED |
IEEE80211_HT_MCS_TX_RX_DIFF |
- ((rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_TXPATH) - 1) <<
- IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT);
+ ((rt2x00dev->default_ant.tx_chain_num - 1) <<
+ IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT);
- switch (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RXPATH)) {
+ switch (rt2x00dev->default_ant.rx_chain_num) {
case 3:
spec->ht.mcs.rx_mask[2] = 0xff;
case 2:
--
1.7.10
^ permalink raw reply related
* [PATCH 2/3] rt2x00: rt2800lib: use switch statement for RF specific setup
From: Gabor Juhos @ 2013-10-14 19:59 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1381780792-28894-1-git-send-email-juhosg@openwrt.org>
It is much more readable than multiple if-else-if
statements.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 51 ++++++++++++++++++-------------
1 file changed, 30 insertions(+), 21 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 3ca0d3e..f143075 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -7504,38 +7504,46 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
spec->supported_bands = SUPPORT_BAND_2GHZ;
spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM;
- if (rt2x00_rf(rt2x00dev, RF2820) ||
- rt2x00_rf(rt2x00dev, RF2720)) {
+ switch (rt2x00dev->chip.rf) {
+ case RF2720:
+ case RF2820:
spec->num_channels = 14;
spec->channels = rf_vals;
- } else if (rt2x00_rf(rt2x00dev, RF2850) ||
- rt2x00_rf(rt2x00dev, RF2750)) {
+ break;
+
+ case RF2750:
+ case RF2850:
spec->supported_bands |= SUPPORT_BAND_5GHZ;
spec->num_channels = ARRAY_SIZE(rf_vals);
spec->channels = rf_vals;
- } else if (rt2x00_rf(rt2x00dev, RF3020) ||
- rt2x00_rf(rt2x00dev, RF2020) ||
- rt2x00_rf(rt2x00dev, RF3021) ||
- rt2x00_rf(rt2x00dev, RF3022) ||
- rt2x00_rf(rt2x00dev, RF3070) ||
- rt2x00_rf(rt2x00dev, RF3290) ||
- rt2x00_rf(rt2x00dev, RF3320) ||
- rt2x00_rf(rt2x00dev, RF3322) ||
- rt2x00_rf(rt2x00dev, RF5360) ||
- rt2x00_rf(rt2x00dev, RF5370) ||
- rt2x00_rf(rt2x00dev, RF5372) ||
- rt2x00_rf(rt2x00dev, RF5390) ||
- rt2x00_rf(rt2x00dev, RF5392)) {
+ break;
+
+ case RF2020:
+ case RF3020:
+ case RF3021:
+ case RF3022:
+ case RF3070:
+ case RF3290:
+ case RF3320:
+ case RF3322:
+ case RF5360:
+ case RF5370:
+ case RF5372:
+ case RF5390:
+ case RF5392:
spec->num_channels = 14;
spec->channels = rf_vals_3x;
- } else if (rt2x00_rf(rt2x00dev, RF3052) ||
- rt2x00_rf(rt2x00dev, RF3053)) {
+ break;
+
+ case RF3052:
+ case RF3053:
spec->supported_bands |= SUPPORT_BAND_5GHZ;
spec->num_channels = ARRAY_SIZE(rf_vals_3x);
spec->channels = rf_vals_3x;
- } else if (rt2x00_rf(rt2x00dev, RF5592)) {
- spec->supported_bands |= SUPPORT_BAND_5GHZ;
+ break;
+ case RF5592:
+ spec->supported_bands |= SUPPORT_BAND_5GHZ;
rt2800_register_read(rt2x00dev, MAC_DEBUG_INDEX, ®);
if (rt2x00_get_field32(reg, MAC_DEBUG_INDEX_XTAL)) {
spec->num_channels = ARRAY_SIZE(rf_vals_5592_xtal40);
@@ -7544,6 +7552,7 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
spec->num_channels = ARRAY_SIZE(rf_vals_5592_xtal20);
spec->channels = rf_vals_5592_xtal20;
}
+ break;
}
if (WARN_ON_ONCE(!spec->channels))
--
1.7.10
^ permalink raw reply related
* [PATCH 3/3] rt2x00: rt2800lib: autodetect 5GHz band support
From: Gabor Juhos @ 2013-10-14 19:59 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1381780792-28894-1-git-send-email-juhosg@openwrt.org>
If the RF chip supports more than 14 channels that
indirectly means that it supports the 5GHz band.
Use this fact to enable 5GHz band support instead
of setting SUPPORT_BAND_5GHZ separately for each
RF chip.
Also move the setup code of the 2GHz band to the
same place.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index f143075..c5738f1 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -7501,7 +7501,6 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Initialize hw_mode information.
*/
- spec->supported_bands = SUPPORT_BAND_2GHZ;
spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM;
switch (rt2x00dev->chip.rf) {
@@ -7513,7 +7512,6 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
case RF2750:
case RF2850:
- spec->supported_bands |= SUPPORT_BAND_5GHZ;
spec->num_channels = ARRAY_SIZE(rf_vals);
spec->channels = rf_vals;
break;
@@ -7537,13 +7535,11 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
case RF3052:
case RF3053:
- spec->supported_bands |= SUPPORT_BAND_5GHZ;
spec->num_channels = ARRAY_SIZE(rf_vals_3x);
spec->channels = rf_vals_3x;
break;
case RF5592:
- spec->supported_bands |= SUPPORT_BAND_5GHZ;
rt2800_register_read(rt2x00dev, MAC_DEBUG_INDEX, ®);
if (rt2x00_get_field32(reg, MAC_DEBUG_INDEX_XTAL)) {
spec->num_channels = ARRAY_SIZE(rf_vals_5592_xtal40);
@@ -7558,6 +7554,10 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
if (WARN_ON_ONCE(!spec->channels))
return -ENODEV;
+ spec->supported_bands = SUPPORT_BAND_2GHZ;
+ if (spec->num_channels > 14)
+ spec->supported_bands |= SUPPORT_BAND_5GHZ;
+
/*
* Initialize HT information.
*/
--
1.7.10
^ permalink raw reply related
* [PATCH 3.12] ath5k: fix regression in tx status processing
From: Felix Fietkau @ 2013-10-14 19:18 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, thomas, bvahl, ben
The regression was introduced in the following commit:
0967e01e8e713ed2982fb4eba8ba13794e9a6e89
"ath5k: make use of the new rate control API"
ath5k_tx_frame_completed saves the intended per-rate retry counts before
they are cleared by ieee80211_tx_info_clear_status, however at this
point the information in info->status.rates is incomplete.
This causes significant throughput degradation and excessive packet loss
on links where high bit rates don't work properly.
Move the copy from bf->rates a few lines up to ensure that the saved
retry counts are updated, and that they are really cleared in
info->status.rates after the call to ieee80211_tx_info_clear_status.
Cc: stable@vger.kernel.org # 3.10+
Cc: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Cc: Benjamin Vahl <bvahl@net.t-labs.tu-berlin.de>
Reported-by: Ben West <ben@gowasabi.net>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
drivers/net/wireless/ath/ath5k/base.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 48161ed..69f58b0 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1663,15 +1663,15 @@ ath5k_tx_frame_completed(struct ath5k_hw *ah, struct sk_buff *skb,
ah->stats.tx_bytes_count += skb->len;
info = IEEE80211_SKB_CB(skb);
+ size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates));
+ memcpy(info->status.rates, bf->rates, size);
+
tries[0] = info->status.rates[0].count;
tries[1] = info->status.rates[1].count;
tries[2] = info->status.rates[2].count;
ieee80211_tx_info_clear_status(info);
- size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates));
- memcpy(info->status.rates, bf->rates, size);
-
for (i = 0; i < ts->ts_final_idx; i++) {
struct ieee80211_tx_rate *r =
&info->status.rates[i];
--
1.8.0.2
^ permalink raw reply related
* [PATCH] staging: vt6656: main_usb.c correct pDevice->pControlURB goto
From: Malcolm Priestley @ 2013-10-14 18:58 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
Correct goto of patch
staging: vt6656: make pControlURB available life time of driver.
Which should free_netdev.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/main_usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 412a776..5e4a5d0 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -710,7 +710,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
pDevice->pControlURB = usb_alloc_urb(0, GFP_ATOMIC);
if (!pDevice->pControlURB) {
DBG_PRT(MSG_LEVEL_ERR, KERN_ERR"Failed to alloc control urb\n");
- goto err_nomem;
+ goto err_netdev;
}
pDevice->tx_80211 = device_dma0_tx_80211;
--
1.8.3.2
^ permalink raw reply related
* [PATCH] staging: vt6656: return from workqueues on fMP_DISCONNECTED
From: Malcolm Priestley @ 2013-10-14 18:51 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
Return from work queues on flag fMP_DISCONNECTED to prevent
any scheduling threads past closing of device.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/bssdb.c | 3 +++
drivers/staging/vt6656/dpc.c | 6 ++++++
drivers/staging/vt6656/wcmd.c | 3 +++
3 files changed, 12 insertions(+)
diff --git a/drivers/staging/vt6656/bssdb.c b/drivers/staging/vt6656/bssdb.c
index ef654c0..dad3f8c 100644
--- a/drivers/staging/vt6656/bssdb.c
+++ b/drivers/staging/vt6656/bssdb.c
@@ -825,6 +825,9 @@ void BSSvSecondCallBack(struct work_struct *work)
u32 uNonShortSlotSTACnt = 0;
u32 uLongPreambleSTACnt = 0;
+ if (pDevice->Flags & fMP_DISCONNECTED)
+ return;
+
spin_lock_irq(&pDevice->lock);
pDevice->uAssocCount = 0;
diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
index 82d7c1d..75dc92d 100644
--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -1339,6 +1339,9 @@ void RXvWorkItem(struct work_struct *work)
int ntStatus;
struct vnt_rcb *pRCB = NULL;
+ if (pDevice->Flags & fMP_DISCONNECTED)
+ return;
+
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Rx Polling Thread\n");
spin_lock_irq(&pDevice->lock);
@@ -1398,6 +1401,9 @@ void RXvMngWorkItem(struct work_struct *work)
struct vnt_rx_mgmt *pRxPacket;
int bReAllocSkb = false;
+ if (pDevice->Flags & fMP_DISCONNECTED)
+ return;
+
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Rx Mng Thread\n");
spin_lock_irq(&pDevice->lock);
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index 4f45a7f..2f8e2a8 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -286,6 +286,9 @@ void vRunCommand(struct work_struct *work)
u8 byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80};
u8 byData;
+ if (pDevice->Flags & fMP_DISCONNECTED)
+ return;
+
if (pDevice->dwDiagRefCount != 0)
return;
if (pDevice->bCmdRunning != true)
--
1.8.3.2
^ permalink raw reply related
* [PATCH] staging vt6656: Remove 10 second timer and move to BSSvSecondCallBack
From: Malcolm Priestley @ 2013-10-14 18:46 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
Remove sTimerTxData 10 second timer which triggers PSbSendNullPacket
every 40 seconds when bLinkPass == true.
Move the 40 second timer to the existing BSSvSecondCallBack
one second delayed workqueue and trigger every 40 seconds when
bLinkPass == true.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/bssdb.c | 21 +++++++++++++----
drivers/staging/vt6656/device.h | 7 ++----
drivers/staging/vt6656/main_usb.c | 2 --
drivers/staging/vt6656/power.c | 6 ++---
drivers/staging/vt6656/usbpipe.c | 2 --
drivers/staging/vt6656/wcmd.c | 47 ---------------------------------------
drivers/staging/vt6656/wcmd.h | 2 --
drivers/staging/vt6656/wmgr.c | 8 -------
8 files changed, 21 insertions(+), 74 deletions(-)
diff --git a/drivers/staging/vt6656/bssdb.c b/drivers/staging/vt6656/bssdb.c
index ae0438a..ef654c0 100644
--- a/drivers/staging/vt6656/bssdb.c
+++ b/drivers/staging/vt6656/bssdb.c
@@ -57,6 +57,7 @@
#include "control.h"
#include "rndis.h"
#include "iowpa.h"
+#include "power.h"
static int msglevel =MSG_LEVEL_INFO;
//static int msglevel =MSG_LEVEL_DEBUG;
@@ -1121,10 +1122,22 @@ else {
}
}
- if (pDevice->bLinkPass == true) {
- if (netif_queue_stopped(pDevice->dev))
- netif_wake_queue(pDevice->dev);
- }
+ if (pDevice->bLinkPass == true) {
+ if (pMgmt->eAuthenMode < WMAC_AUTH_WPA ||
+ pDevice->fWPA_Authened == true) {
+ if (++pDevice->tx_data_time_out > 40) {
+ pDevice->tx_trigger = true;
+
+ PSbSendNullPacket(pDevice);
+
+ pDevice->tx_trigger = false;
+ pDevice->tx_data_time_out = 0;
+ }
+ }
+
+ if (netif_queue_stopped(pDevice->dev))
+ netif_wake_queue(pDevice->dev);
+ }
spin_unlock_irq(&pDevice->lock);
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index fa1cefb..95b181d 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -711,11 +711,8 @@ struct vnt_private {
/* One second callback */
struct delayed_work second_callback_work;
- struct timer_list sTimerTxData;
- unsigned long nTxDataTimeCout;
- int fTxDataInSleep;
- int IsTxDataTrigger;
-
+ u8 tx_data_time_out;
+ bool tx_trigger;
int fWPA_Authened; /*is WPA/WPA-PSK or WPA2/WPA2-PSK authen?? */
u8 byReAssocCount;
u8 byLinkWaitCount;
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 0de2156..412a776 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -1081,8 +1081,6 @@ static int device_close(struct net_device *dev)
cancel_delayed_work_sync(&pDevice->run_command_work);
cancel_delayed_work_sync(&pDevice->second_callback_work);
- del_timer(&pDevice->sTimerTxData);
-
if (pDevice->bDiversityRegCtlON) {
del_timer(&pDevice->TimerSQ3Tmax1);
del_timer(&pDevice->TimerSQ3Tmax2);
diff --git a/drivers/staging/vt6656/power.c b/drivers/staging/vt6656/power.c
index edc8975..6334315 100644
--- a/drivers/staging/vt6656/power.c
+++ b/drivers/staging/vt6656/power.c
@@ -257,10 +257,8 @@ int PSbSendNullPacket(struct vnt_private *pDevice)
if (pDevice->bLinkPass == false)
return false;
- if ((pDevice->bEnablePSMode == false) &&
- (pDevice->fTxDataInSleep == false)) {
- return false;
- }
+ if (pDevice->bEnablePSMode == false && pDevice->tx_trigger == false)
+ return false;
memset(pMgmt->pbyPSPacketPool, 0, sizeof(struct vnt_tx_mgmt)
+ WLAN_NULLDATA_FR_MAXLEN);
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
index 37bcb18..5fc18ad 100644
--- a/drivers/staging/vt6656/usbpipe.c
+++ b/drivers/staging/vt6656/usbpipe.c
@@ -662,8 +662,6 @@ static void s_nsBulkOutIoCompleteWrite(struct urb *urb)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Write %d bytes\n",(int)ulBufLen);
pDevice->ulBulkOutBytesWrite += ulBufLen;
pDevice->ulBulkOutContCRCError = 0;
- pDevice->nTxDataTimeCout = 0;
-
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"BULK Out failed %d\n", status);
pDevice->ulBulkOutError++;
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index debb87a..4f45a7f 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -654,22 +654,6 @@ void vRunCommand(struct work_struct *work)
netif_wake_queue(pDevice->dev);
}
- if(pDevice->IsTxDataTrigger != false) { //TxDataTimer is not triggered at the first time
- // printk("Re-initial TxDataTimer****\n");
- del_timer(&pDevice->sTimerTxData);
- init_timer(&pDevice->sTimerTxData);
- pDevice->sTimerTxData.data = (unsigned long) pDevice;
- pDevice->sTimerTxData.function = (TimerFunction)BSSvSecondTxData;
- pDevice->sTimerTxData.expires = RUN_AT(10*HZ); //10s callback
- pDevice->fTxDataInSleep = false;
- pDevice->nTxDataTimeCout = 0;
- }
- else {
- // printk("mike:-->First time trigger TimerTxData InSleep\n");
- }
- pDevice->IsTxDataTrigger = true;
- add_timer(&pDevice->sTimerTxData);
-
}
else if(pMgmt->eCurrState < WMAC_STATE_ASSOCPENDING) {
printk("WLAN_ASSOCIATE_WAIT:Association Fail???\n");
@@ -681,7 +665,6 @@ void vRunCommand(struct work_struct *work)
vCommandTimerWait((void *) pDevice, ASSOCIATE_TIMEOUT/2);
return;
}
- pDevice->byLinkWaitCount = 0;
s_bCommandComplete(pDevice);
break;
@@ -1159,33 +1142,3 @@ void vResetCommandTimer(struct vnt_private *pDevice)
pDevice->bCmdRunning = false;
pDevice->bCmdClear = false;
}
-
-void BSSvSecondTxData(struct vnt_private *pDevice)
-{
- struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
-
- pDevice->nTxDataTimeCout++;
-
- if (pDevice->nTxDataTimeCout < 4) { //don't tx data if timer less than 40s
- // printk("mike:%s-->no data Tx not exceed the desired Time as %d\n",__FUNCTION__,
- // (int)pDevice->nTxDataTimeCout);
- pDevice->sTimerTxData.expires = RUN_AT(10 * HZ); //10s callback
- add_timer(&pDevice->sTimerTxData);
- return;
- }
-
- spin_lock_irq(&pDevice->lock);
- //is wap_supplicant running successful OR only open && sharekey mode!
- if (((pDevice->bLinkPass == true) &&
- (pMgmt->eAuthenMode < WMAC_AUTH_WPA)) || //open && sharekey linking
- (pDevice->fWPA_Authened == true)) { //wpa linking
- // printk("mike:%s-->InSleep Tx Data Procedure\n",__FUNCTION__);
- pDevice->fTxDataInSleep = true;
- PSbSendNullPacket(pDevice); //send null packet
- pDevice->fTxDataInSleep = false;
- }
- spin_unlock_irq(&pDevice->lock);
-
- pDevice->sTimerTxData.expires = RUN_AT(10 * HZ); //10s callback
- add_timer(&pDevice->sTimerTxData);
-}
diff --git a/drivers/staging/vt6656/wcmd.h b/drivers/staging/vt6656/wcmd.h
index cd12558..caf2684 100644
--- a/drivers/staging/vt6656/wcmd.h
+++ b/drivers/staging/vt6656/wcmd.h
@@ -107,6 +107,4 @@ int bScheduleCommand(struct vnt_private *, CMD_CODE eCommand, u8 *pbyItem0);
void vRunCommand(struct work_struct *work);
-void BSSvSecondTxData(struct vnt_private *);
-
#endif /* __WCMD_H__ */
diff --git a/drivers/staging/vt6656/wmgr.c b/drivers/staging/vt6656/wmgr.c
index 5a6a5ba..6300a56 100644
--- a/drivers/staging/vt6656/wmgr.c
+++ b/drivers/staging/vt6656/wmgr.c
@@ -213,14 +213,6 @@ void vMgrObjectInit(struct vnt_private *pDevice)
pMgmt->wIBSSBeaconPeriod = DEFAULT_IBSS_BI;
BSSvClearBSSList((void *) pDevice, false);
- init_timer(&pDevice->sTimerTxData);
- pDevice->sTimerTxData.data = (unsigned long)pDevice;
- pDevice->sTimerTxData.function = (TimerFunction)BSSvSecondTxData;
- pDevice->sTimerTxData.expires = RUN_AT(10*HZ); //10s callback
- pDevice->fTxDataInSleep = false;
- pDevice->IsTxDataTrigger = false;
- pDevice->nTxDataTimeCout = 0;
-
pDevice->cbFreeCmdQueue = CMD_Q_SIZE;
pDevice->uCmdDequeueIdx = 0;
pDevice->uCmdEnqueueIdx = 0;
--
1.8.3.2
^ permalink raw reply related
* [PATCH] staging: vt6656: return if pControlURB->hcpriv not NULL
From: Malcolm Priestley @ 2013-10-14 18:44 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
Fixes occasional urb submitted while active.
Even thought the fMP_CONTROL_WRITES/fMP_CONTROL_READS flags
are cleared in the return context urb->hcpriv is not NULL.
check for hcpriv and return STATUS_FAILURE if not NULL.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/usbpipe.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
index 3a03f1d..37bcb18 100644
--- a/drivers/staging/vt6656/usbpipe.c
+++ b/drivers/staging/vt6656/usbpipe.c
@@ -118,6 +118,9 @@ int PIPEnsControlOut(struct vnt_private *pDevice, u8 byRequest, u16 wValue,
if (pDevice->Flags & fMP_CONTROL_READS)
return STATUS_FAILURE;
+ if (pDevice->pControlURB->hcpriv)
+ return STATUS_FAILURE;
+
MP_SET_FLAG(pDevice, fMP_CONTROL_WRITES);
pDevice->sUsbCtlRequest.bRequestType = 0x40;
@@ -177,6 +180,9 @@ int PIPEnsControlIn(struct vnt_private *pDevice, u8 byRequest, u16 wValue,
if (pDevice->Flags & fMP_CONTROL_WRITES)
return STATUS_FAILURE;
+ if (pDevice->pControlURB->hcpriv)
+ return STATUS_FAILURE;
+
MP_SET_FLAG(pDevice, fMP_CONTROL_READS);
pDevice->sUsbCtlRequest.bRequestType = 0xC0;
--
1.8.3.2
^ permalink raw reply related
* [PATCH] mac80211_hwsim: Add iface comb for DFS
From: Janusz Dziedzic @ 2013-10-14 17:51 UTC (permalink / raw)
To: linux-wireless; +Cc: Janusz Dziedzic
Add iface combination that allow DFS support.
Add also debugfs dfs_simulate_radar file that
can be used to simulate radar event.
This could be usefull for mac80211/cfg80211/
regulatory/hostap code testing without real HW.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
drivers/net/wireless/mac80211_hwsim.c | 51 +++++++++++++++++++++++++++------
1 file changed, 43 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 2cd3f54..1a4eca0 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -370,6 +370,8 @@ struct mac80211_hwsim_data {
s64 bcn_delta;
/* absolute beacon transmission time. Used to cover up "tx" delay. */
u64 abs_bcn_ts;
+
+ struct dentry *debugfs_radar;
};
@@ -1714,6 +1716,7 @@ static void mac80211_hwsim_free(void)
list_for_each_entry_safe(data, tmpdata, &tmplist, list) {
debugfs_remove(data->debugfs_group);
+ debugfs_remove(data->debugfs_radar);
debugfs_remove(data->debugfs_ps);
debugfs_remove(data->debugfs);
ieee80211_unregister_hw(data->hw);
@@ -1872,6 +1875,17 @@ static int hwsim_fops_ps_write(void *dat, u64 val)
DEFINE_SIMPLE_ATTRIBUTE(hwsim_fops_ps, hwsim_fops_ps_read, hwsim_fops_ps_write,
"%llu\n");
+static int hwsim_write_simulate_radar(void *dat, u64 val)
+{
+ struct mac80211_hwsim_data *data = dat;
+
+ ieee80211_radar_detected(data->hw);
+
+ return 0;
+}
+
+DEFINE_SIMPLE_ATTRIBUTE(hwsim_simulate_radar, NULL,
+ hwsim_write_simulate_radar, "%llu\n");
static int hwsim_fops_group_read(void *dat, u64 *val)
{
@@ -2173,11 +2187,28 @@ static const struct ieee80211_iface_limit hwsim_if_limits[] = {
{ .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) },
};
-static struct ieee80211_iface_combination hwsim_if_comb = {
- .limits = hwsim_if_limits,
- .n_limits = ARRAY_SIZE(hwsim_if_limits),
- .max_interfaces = 2048,
- .num_different_channels = 1,
+static const struct ieee80211_iface_limit hwsim_if_dfs_limits[] = {
+ { .max = 8, .types = BIT(NL80211_IFTYPE_AP) },
+};
+
+static struct ieee80211_iface_combination hwsim_if_comb[] = {
+ {
+ .limits = hwsim_if_limits,
+ .n_limits = ARRAY_SIZE(hwsim_if_limits),
+ .max_interfaces = 2048,
+ .num_different_channels = 1,
+ },
+ {
+ .limits = hwsim_if_dfs_limits,
+ .n_limits = ARRAY_SIZE(hwsim_if_dfs_limits),
+ .max_interfaces = 8,
+ .num_different_channels = 1,
+ .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
+ BIT(NL80211_CHAN_WIDTH_20) |
+ BIT(NL80211_CHAN_WIDTH_40) |
+ BIT(NL80211_CHAN_WIDTH_80) |
+ BIT(NL80211_CHAN_WIDTH_160),
+ }
};
static int __init init_mac80211_hwsim(void)
@@ -2195,7 +2226,7 @@ static int __init init_mac80211_hwsim(void)
return -EINVAL;
if (channels > 1) {
- hwsim_if_comb.num_different_channels = channels;
+ hwsim_if_comb[0].num_different_channels = channels;
mac80211_hwsim_ops.hw_scan = mac80211_hwsim_hw_scan;
mac80211_hwsim_ops.cancel_hw_scan =
mac80211_hwsim_cancel_hw_scan;
@@ -2275,8 +2306,8 @@ static int __init init_mac80211_hwsim(void)
hw->wiphy->n_addresses = 2;
hw->wiphy->addresses = data->addresses;
- hw->wiphy->iface_combinations = &hwsim_if_comb;
- hw->wiphy->n_iface_combinations = 1;
+ hw->wiphy->iface_combinations = hwsim_if_comb;
+ hw->wiphy->n_iface_combinations = ARRAY_SIZE(hwsim_if_comb);
if (channels > 1) {
hw->wiphy->max_scan_ssids = 255;
@@ -2519,6 +2550,10 @@ static int __init init_mac80211_hwsim(void)
data->debugfs_group = debugfs_create_file("group", 0666,
data->debugfs, data,
&hwsim_fops_group);
+ data->debugfs_radar = debugfs_create_file("dfs_simulate_radar",
+ 0222, data->debugfs,
+ data,
+ &hwsim_simulate_radar);
tasklet_hrtimer_init(&data->beacon_timer,
mac80211_hwsim_beacon,
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH v4 3/6] mac80211: add the CSA and MCSP elements in mesh beaconing
From: Chun-Yeow Yeoh @ 2013-10-14 17:49 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, John Linville, devel, distro11s@cozybit.com
In-Reply-To: <1381772716.13092.21.camel@jlt4.sipsolutions.net>
> It occurs after later patches only though, and this patch introduces an
> RCU warning. I'd suggest to roll this into patch 5 or so since there
> it's really only used?
It make sense. I will do that.
----
Chun-Yeow
^ permalink raw reply
* Re: [PATCH v4 3/6] mac80211: add the CSA and MCSP elements in mesh beaconing
From: Johannes Berg @ 2013-10-14 17:45 UTC (permalink / raw)
To: Chun-Yeow Yeoh
Cc: linux-wireless, John Linville, devel, distro11s@cozybit.com
In-Reply-To: <CAHS2MGMONy37xZedzRhx10Mes9MCUMfiEjmWjprVOEQY_brw9Q@mail.gmail.com>
On Tue, 2013-10-15 at 01:15 +0800, Chun-Yeow Yeoh wrote:
> > Does this even make sense here - it can't ever be non-NULL in this
> > patch?
> Actually, the NULL and non-NULL situation should occur here. Whenever
> the node triggers the channel switching period, it will append CSA and
> MCSP elements in the beacon.
It occurs after later patches only though, and this patch introduces an
RCU warning. I'd suggest to roll this into patch 5 or so since there
it's really only used?
johannes
^ permalink raw reply
* Re: pull-request: mac80211 2013-10-14
From: John W. Linville @ 2013-10-14 17:34 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1381736981.13092.4.camel@jlt4.sipsolutions.net>
On Mon, Oct 14, 2013 at 09:49:45AM +0200, Johannes Berg wrote:
> John,
>
> I know it's getting later in the game (rc5 is out) and my last pull
> request hasn't even made it into Linus's tree, but we still have some
> fixes ...
>
> This time I have two fixes from Emmanuel for RF-kill issues, and fixed
> two issues reported by Evan Huus and Thomas Lindroth respectively.
>
> Let me know if there's any problem.
>
> johannes
>
> The following changes since commit 22c4ceed0184318ec5a6182c6d75d398452c2e39:
>
> mac80211: Run deferred scan if last roc_list item is not started (2013-09-30 12:36:56 +0200)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git for-john
>
> for you to fetch changes up to d86aa4f8ca58898ec6a94c0635da20b948171ed7:
>
> mac80211: fix crash if bitrate calculation goes wrong (2013-10-14 09:47:08 +0200)
Pulling now...
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* Re: [PATCH v4 5/6] {nl,cfg,mac}80211: finalizing mesh channel switching
From: Chun-Yeow Yeoh @ 2013-10-14 17:17 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, John Linville, devel, distro11s@cozybit.com
In-Reply-To: <1381760529.13092.17.camel@jlt4.sipsolutions.net>
> subject should read "finalize" or something I guess? Though it really
> isn't clear to me why you split up the patches as is and didn't just put
> 3/5 together as "implement mesh channel switch userspace API" or so?
I split the patches because I would like the CSA to work without even
the beacon involvement, only CSA action frame. But I will take a look
on this again.
> I don't think this belongs here, it's certainly not needed for the API.
> Maybe you need a wrapper struct or so?
Alright, will do so.
----
Chun-Yeow
^ permalink raw reply
* Re: [PATCH v4 2/6] {nl,cfg,mac}80211: enable the triggering of CSA frame in mesh
From: Chun-Yeow Yeoh @ 2013-10-14 17:15 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, John Linville, devel, distro11s@cozybit.com
In-Reply-To: <1381760087.13092.12.camel@jlt4.sipsolutions.net>
> How will userspace know whether or not this is supported? Will it just
> try and fail? Does it really not need to know?
The userspace will only try and fail at the time being. If it is
failed, the initiator will still remain at the current operating
channel.
---
Chun-Yeow
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox