* Re: [PATCH 1/5] nl80211: support sending TDLS commands/frames
From: Johannes Berg @ 2011-09-27 11:43 UTC (permalink / raw)
To: Arik Nemtsov; +Cc: linux-wireless, Kalyan C Gaddam
In-Reply-To: <1317034493-5300-2-git-send-email-arik@wizery.com>
On Mon, 2011-09-26 at 13:54 +0300, Arik Nemtsov wrote:
> @@ -876,6 +884,8 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
> }
> CMD(set_channel, SET_CHANNEL);
> CMD(set_wds_peer, SET_WDS_PEER);
> + CMD(tdls_mgmt, TDLS_MGMT);
Should that maybe depend on the TLDS_EXTERNAL_SETUP flag to avoid
inconsistencies? Especially with mac80211 drivers?
> + CMD(tdls_oper, TDLS_OPER);
and maybe not advertise that if TDLS isn't support -- in particular so
that mac80211 drivers don't advertise it even though mac80211 might have
the hook.
> +static int nl80211_tdls_mgmt(struct sk_buff *skb, struct genl_info *info)
> +{
> + struct cfg80211_registered_device *rdev = info->user_ptr[0];
> + struct net_device *dev = info->user_ptr[1];
> + u8 action_code, dialog_token;
> + u16 status_code;
> + u8 *peer;
> +
> + if (!rdev->ops->tdls_mgmt)
> + return -EOPNOTSUPP;
> +
> + if (!info->attrs[NL80211_ATTR_TDLS_ACTION] ||
> + !info->attrs[NL80211_ATTR_STATUS_CODE] ||
> + !info->attrs[NL80211_ATTR_TDLS_DIALOG_TOKEN] ||
> + !info->attrs[NL80211_ATTR_IE] ||
> + !info->attrs[NL80211_ATTR_MAC])
> + return -EINVAL;
> +
> + peer = nla_data(info->attrs[NL80211_ATTR_MAC]);
> + action_code = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_ACTION]);
> + status_code = nla_get_u16(info->attrs[NL80211_ATTR_STATUS_CODE]);
> + dialog_token = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_DIALOG_TOKEN]);
> +
> + return rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
> + dialog_token, status_code,
> + nla_data(info->attrs[NL80211_ATTR_IE]),
> + nla_len(info->attrs[NL80211_ATTR_IE]));
> +}
Shouldn't that return an error if TDLS_EXTERNAL_SETUP isn't set? At
least for some operations?
> +static int nl80211_tdls_oper(struct sk_buff *skb, struct genl_info *info)
> +{
> + struct cfg80211_registered_device *rdev = info->user_ptr[0];
> + struct net_device *dev = info->user_ptr[1];
> + enum nl80211_tdls_operation operation;
> + u8 *peer;
> +
> + if (!rdev->ops->tdls_oper)
> + return -EOPNOTSUPP;
> +
> + if (!info->attrs[NL80211_ATTR_TDLS_OPERATION] ||
> + !info->attrs[NL80211_ATTR_MAC])
> + return -EINVAL;
> +
> + operation = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_OPERATION]);
> + peer = nla_data(info->attrs[NL80211_ATTR_MAC]);
> +
> + return rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, operation);
> +}
Ditto here, if TDLS isn't supported it needs to return an error I think,
and if TLDS needs external setup it needs to return errors for the setup
operations I think?
johannes
^ permalink raw reply
* Re: [RFC] mac80211: remove per band sta supported rates
From: Johannes Berg @ 2011-09-27 11:34 UTC (permalink / raw)
To: Stanislaw Gruszka; +Cc: linux-wireless
In-Reply-To: <1317121970-3638-1-git-send-email-sgruszka@redhat.com>
On Tue, 2011-09-27 at 13:12 +0200, Stanislaw Gruszka wrote:
> It is not possible to connect to remote station on two bands
> at once, or I'm wrong?
I don't think it is, but there could be channel switches maybe?
> As side effect this patch fix warning in
> rate_control_send_low (or rather mask the real problem):
>
> https://bugzilla.redhat.com/show_bug.cgi?id=731365
>
> Which may happen when we are just after disassociation and changed
> channel/band, but still want send some frames (namely delBA) to old
> sta. Right fix should prevent to change channel before we fully
> dissassocate, or prevent to send frames after connection is lost,
> or both, but I don't know how to correctly do this so far.
Well, either we should simply not send the frame, or send it before
disassoc, no?
johannes
^ permalink raw reply
* [PATCH 4/4] ath6kl: improve wmi debug messages
From: Kalle Valo @ 2011-09-27 11:31 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20110927113045.11592.15974.stgit@localhost6.localdomain6>
Add a new debug level ATH6KL_DBG_WMI_DUMP and other minor
improvements to the wmi debug messages.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/debug.h | 3 +-
drivers/net/wireless/ath/ath6kl/wmi.c | 44 +++++++++++++++++++++++++------
2 files changed, 37 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index 6288e4c..48339da 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -34,11 +34,12 @@ enum ATH6K_DEBUG_MASK {
ATH6KL_DBG_TRC = BIT(11), /* generic func tracing */
ATH6KL_DBG_SCATTER = BIT(12), /* hif scatter tracing */
ATH6KL_DBG_WLAN_CFG = BIT(13), /* cfg80211 i/f file tracing */
- ATH6KL_DBG_RAW_BYTES = BIT(14), /* dump tx/rx and wmi frames */
+ ATH6KL_DBG_RAW_BYTES = BIT(14), /* dump tx/rx frames */
ATH6KL_DBG_AGGR = BIT(15), /* aggregation */
ATH6KL_DBG_SDIO = BIT(16),
ATH6KL_DBG_SDIO_DUMP = BIT(17),
ATH6KL_DBG_BOOT = BIT(18), /* driver init and fw boot */
+ ATH6KL_DBG_WMI_DUMP = BIT(19),
ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */
};
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 785a8c7..a7de23c 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -721,8 +721,12 @@ static int ath6kl_wmi_connect_event_rx(struct wmi *wmi, u8 *datap, int len)
/* STA/IBSS mode connection event */
- ath6kl_dbg(ATH6KL_DBG_WMI, "%s: freq %d bssid %pM\n",
- __func__, le16_to_cpu(ev->u.sta.ch), ev->u.sta.bssid);
+ ath6kl_dbg(ATH6KL_DBG_WMI,
+ "wmi event connect freq %d bssid %pM listen_intvl %d beacon_intvl %d type %d\n",
+ le16_to_cpu(ev->u.sta.ch), ev->u.sta.bssid,
+ le16_to_cpu(ev->u.sta.listen_intvl),
+ le16_to_cpu(ev->u.sta.beacon_intvl),
+ le32_to_cpu(ev->u.sta.nw_type));
/* Start of assoc rsp IEs */
pie = ev->assoc_info + ev->beacon_ie_len +
@@ -822,7 +826,7 @@ static void ath6kl_wmi_regdomain_event(struct wmi *wmi, u8 *datap, int len)
regpair = ath6kl_get_regpair((u16) reg_code);
country = ath6kl_regd_find_country_by_rd((u16) reg_code);
- ath6kl_dbg(ATH6KL_DBG_WMI, "ath6kl: Regpair used: 0x%0x\n",
+ ath6kl_dbg(ATH6KL_DBG_WMI, "Regpair used: 0x%0x\n",
regpair->regDmnEnum);
}
@@ -832,7 +836,7 @@ static void ath6kl_wmi_regdomain_event(struct wmi *wmi, u8 *datap, int len)
regulatory_hint(wmi->parent_dev->wdev->wiphy, alpha2);
- ath6kl_dbg(ATH6KL_DBG_WMI, "ath6kl: Country alpha2 being used: %c%c\n",
+ ath6kl_dbg(ATH6KL_DBG_WMI, "Country alpha2 being used: %c%c\n",
alpha2[0], alpha2[1]);
}
}
@@ -847,6 +851,11 @@ static int ath6kl_wmi_disconnect_event_rx(struct wmi *wmi, u8 *datap, int len)
ev = (struct wmi_disconnect_event *) datap;
+ ath6kl_dbg(ATH6KL_DBG_WMI,
+ "wmi event disconnect proto_reason %d bssid %pM wmi_reason %d assoc_resp_len %d\n",
+ le16_to_cpu(ev->proto_reason_status), ev->bssid,
+ ev->disconn_reason, ev->assoc_resp_len);
+
wmi->is_wmm_enabled = false;
wmi->pair_crypto_type = NONE_CRYPT;
wmi->grp_crypto_type = NONE_CRYPT;
@@ -1526,11 +1535,14 @@ int ath6kl_wmi_cmd_send(struct wmi *wmi, struct sk_buff *skb,
enum htc_endpoint_id ep_id = wmi->ep_id;
int ret;
- ath6kl_dbg(ATH6KL_DBG_WMI, "%s: cmd_id=%d\n", __func__, cmd_id);
-
if (WARN_ON(skb == NULL))
return -EINVAL;
+ ath6kl_dbg(ATH6KL_DBG_WMI, "wmi tx id %d len %d flag %d\n",
+ cmd_id, skb->len, sync_flag);
+ ath6kl_dbg_dump(ATH6KL_DBG_WMI_DUMP, NULL, "wmi tx ",
+ skb->data, skb->len);
+
if (sync_flag >= END_WMIFLAG) {
dev_kfree_skb(skb);
return -EINVAL;
@@ -1589,6 +1601,13 @@ int ath6kl_wmi_connect_cmd(struct wmi *wmi, enum network_type nw_type,
struct wmi_connect_cmd *cc;
int ret;
+ ath6kl_dbg(ATH6KL_DBG_WMI,
+ "wmi connect bssid %pM freq %d flags 0x%x ssid_len %d "
+ "type %d dot11_auth %d auth %d pairwise %d group %d\n",
+ bssid, channel, ctrl_flags, ssid_len, nw_type,
+ dot11_auth_mode, auth_mode, pairwise_crypto, group_crypto);
+ ath6kl_dbg_dump(ATH6KL_DBG_WMI, NULL, "ssid ", ssid, ssid_len);
+
wmi->traffic_class = 100;
if ((pairwise_crypto == NONE_CRYPT) && (group_crypto != NONE_CRYPT))
@@ -1634,6 +1653,9 @@ int ath6kl_wmi_reconnect_cmd(struct wmi *wmi, u8 *bssid, u16 channel)
struct wmi_reconnect_cmd *cc;
int ret;
+ ath6kl_dbg(ATH6KL_DBG_WMI, "wmi reconnect bssid %pM freq %d\n",
+ bssid, channel);
+
wmi->traffic_class = 100;
skb = ath6kl_wmi_get_new_buf(sizeof(struct wmi_reconnect_cmd));
@@ -1656,6 +1678,8 @@ int ath6kl_wmi_disconnect_cmd(struct wmi *wmi)
{
int ret;
+ ath6kl_dbg(ATH6KL_DBG_WMI, "wmi disconnect\n");
+
wmi->traffic_class = 100;
/* Disconnect command does not need to do a SYNC before. */
@@ -2808,12 +2832,14 @@ static int ath6kl_wmi_control_rx_xtnd(struct wmi *wmi, struct sk_buff *skb)
switch (id) {
case WMIX_HB_CHALLENGE_RESP_EVENTID:
+ ath6kl_dbg(ATH6KL_DBG_WMI, "wmi event hb challenge resp\n");
break;
case WMIX_DBGLOG_EVENTID:
+ ath6kl_dbg(ATH6KL_DBG_WMI, "wmi event dbglog len %d\n", len);
ath6kl_debug_fwlog_event(wmi->parent_dev, datap, len);
break;
default:
- ath6kl_err("unknown cmd id 0x%x\n", id);
+ ath6kl_warn("unknown cmd id 0x%x\n", id);
wmi->stat.cmd_id_err++;
ret = -EINVAL;
break;
@@ -2849,8 +2875,8 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb)
datap = skb->data;
len = skb->len;
- ath6kl_dbg(ATH6KL_DBG_WMI, "%s: wmi id: %d\n", __func__, id);
- ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "msg payload ", "wmi rx ",
+ ath6kl_dbg(ATH6KL_DBG_WMI, "wmi rx id %d len %d\n", id, len);
+ ath6kl_dbg_dump(ATH6KL_DBG_WMI_DUMP, NULL, "wmi rx ",
datap, len);
switch (id) {
^ permalink raw reply related
* [PATCH 3/4] ath6kl: add debug logs for booting
From: Kalle Valo @ 2011-09-27 11:31 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20110927113045.11592.15974.stgit@localhost6.localdomain6>
Just to make it easier to find out why boot fails.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/debug.h | 1
drivers/net/wireless/ath/ath6kl/init.c | 71 +++++++++++++++++++++++++++----
2 files changed, 63 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index 63eb1c1..6288e4c 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -38,6 +38,7 @@ enum ATH6K_DEBUG_MASK {
ATH6KL_DBG_AGGR = BIT(15), /* aggregation */
ATH6KL_DBG_SDIO = BIT(16),
ATH6KL_DBG_SDIO_DUMP = BIT(17),
+ ATH6KL_DBG_BOOT = BIT(18), /* driver init and fw boot */
ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */
};
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index e9785fe..876b6b2 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -958,6 +958,9 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
switch (ie_id) {
case ATH6KL_FW_IE_OTP_IMAGE:
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "found otp image ie (%d B)\n",
+ ie_len);
+
ar->fw_otp = kmemdup(data, ie_len, GFP_KERNEL);
if (ar->fw_otp == NULL) {
@@ -968,6 +971,9 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
ar->fw_otp_len = ie_len;
break;
case ATH6KL_FW_IE_FW_IMAGE:
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "found fw image ie (%d B)\n",
+ ie_len);
+
ar->fw = kmemdup(data, ie_len, GFP_KERNEL);
if (ar->fw == NULL) {
@@ -978,6 +984,9 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
ar->fw_len = ie_len;
break;
case ATH6KL_FW_IE_PATCH_IMAGE:
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "found patch image ie (%d B)\n",
+ ie_len);
+
ar->fw_patch = kmemdup(data, ie_len, GFP_KERNEL);
if (ar->fw_patch == NULL) {
@@ -990,8 +999,16 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
case ATH6KL_FW_IE_RESERVED_RAM_SIZE:
val = (__le32 *) data;
ar->hw.reserved_ram_size = le32_to_cpup(val);
+
+ ath6kl_dbg(ATH6KL_DBG_BOOT,
+ "found reserved ram size ie 0x%d\n",
+ ar->hw.reserved_ram_size);
break;
case ATH6KL_FW_IE_CAPABILITIES:
+ ath6kl_dbg(ATH6KL_DBG_BOOT,
+ "found firmware capabilities ie (%d B)\n",
+ ie_len);
+
for (i = 0; i < ATH6KL_FW_CAPABILITY_MAX; i++) {
index = ALIGN(i, 8) / 8;
bit = i % 8;
@@ -999,6 +1016,10 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
if (data[index] & (1 << bit))
__set_bit(i, ar->fw_capabilities);
}
+
+ ath6kl_dbg_dump(ATH6KL_DBG_BOOT, "capabilities", "",
+ ar->fw_capabilities,
+ sizeof(ar->fw_capabilities));
break;
case ATH6KL_FW_IE_PATCH_ADDR:
if (ie_len != sizeof(*val))
@@ -1006,9 +1027,13 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
val = (__le32 *) data;
ar->hw.dataset_patch_addr = le32_to_cpup(val);
+
+ ath6kl_dbg(ATH6KL_DBG_BOOT,
+ "found patch address ie 0x%d\n",
+ ar->hw.dataset_patch_addr);
break;
default:
- ath6kl_dbg(ATH6KL_DBG_TRC, "Unknown fw ie: %u\n",
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "Unknown fw ie: %u\n",
le32_to_cpup(&hdr->id));
break;
}
@@ -1033,14 +1058,17 @@ static int ath6kl_fetch_firmwares(struct ath6kl *ar)
return ret;
ret = ath6kl_fetch_fw_api2(ar);
- if (ret == 0)
- /* fw api 2 found, use it */
+ if (ret == 0) {
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "using fw api 2\n");
return 0;
+ }
ret = ath6kl_fetch_fw_api1(ar);
if (ret)
return ret;
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "using fw api 1\n");
+
return 0;
}
@@ -1071,18 +1099,12 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)
(u8 *) &board_address, 4);
}
- ath6kl_dbg(ATH6KL_DBG_TRC, "board data download addr: 0x%x\n",
- board_address);
-
/* determine where in target ram to write extended board data */
ath6kl_bmi_read(ar,
ath6kl_get_hi_item_addr(ar,
HI_ITEM(hi_board_ext_data)),
(u8 *) &board_ext_address, 4);
- ath6kl_dbg(ATH6KL_DBG_TRC, "board file download addr: 0x%x\n",
- board_ext_address);
-
if (board_ext_address == 0) {
ath6kl_err("Failed to get board file target address.\n");
return -EINVAL;
@@ -1107,6 +1129,10 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)
board_ext_data_size)) {
/* write extended board data */
+ ath6kl_dbg(ATH6KL_DBG_BOOT,
+ "writing extended board data to 0x%x (%d B)\n",
+ board_ext_address, board_ext_data_size);
+
ret = ath6kl_bmi_write(ar, board_ext_address,
ar->fw_board + board_data_size,
board_ext_data_size);
@@ -1131,6 +1157,9 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)
return ret;
}
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "writing board file to 0x%x (%d B)\n",
+ board_address, board_data_size);
+
ret = ath6kl_bmi_write(ar, board_address, ar->fw_board,
board_data_size);
@@ -1159,6 +1188,9 @@ static int ath6kl_upload_otp(struct ath6kl *ar)
address = ar->hw.app_load_addr;
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "writing otp to 0x%x (%d B)\n", address,
+ ar->fw_otp_len);
+
ret = ath6kl_bmi_fast_download(ar, address, ar->fw_otp,
ar->fw_otp_len);
if (ret) {
@@ -1179,7 +1211,11 @@ static int ath6kl_upload_otp(struct ath6kl *ar)
ar->hw.app_start_override_addr = address;
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "app_start_override_addr 0x%x\n",
+ ar->hw.app_start_override_addr);
+
/* execute the OTP code */
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "executing OTP at 0x%x\n", address);
param = 0;
ath6kl_bmi_execute(ar, address, ¶m);
@@ -1196,6 +1232,9 @@ static int ath6kl_upload_firmware(struct ath6kl *ar)
address = ar->hw.app_load_addr;
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "writing firmware to 0x%x (%d B)\n",
+ address, ar->fw_len);
+
ret = ath6kl_bmi_fast_download(ar, address, ar->fw, ar->fw_len);
if (ret) {
@@ -1224,6 +1263,9 @@ static int ath6kl_upload_patch(struct ath6kl *ar)
address = ar->hw.dataset_patch_addr;
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "writing patch to 0x%x (%d B)\n",
+ address, ar->fw_patch_len);
+
ret = ath6kl_bmi_write(ar, address, ar->fw_patch, ar->fw_patch_len);
if (ret) {
ath6kl_err("Failed to write patch file: %d\n", ret);
@@ -1396,6 +1438,15 @@ static int ath6kl_init_hw_params(struct ath6kl *ar)
return -EINVAL;
}
+ ath6kl_dbg(ATH6KL_DBG_BOOT,
+ "target_ver 0x%x target_type 0x%x dataset_patch 0x%x app_load_addr 0x%x\n",
+ ar->version.target_ver, ar->target_type,
+ ar->hw.dataset_patch_addr, ar->hw.app_load_addr);
+ ath6kl_dbg(ATH6KL_DBG_BOOT,
+ "app_start_override_addr 0x%x board_ext_data_addr 0x%x reserved_ram_size 0x%x",
+ ar->hw.app_start_override_addr, ar->hw.board_ext_data_addr,
+ ar->hw.reserved_ram_size);
+
return 0;
}
@@ -1472,6 +1523,8 @@ static int ath6kl_init(struct net_device *dev)
&ar->flag),
WMI_TIMEOUT);
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "firmware booted\n");
+
if (ar->version.abi_ver != ATH6KL_ABI_VERSION) {
ath6kl_err("abi version mismatch: host(0x%x), target(0x%x)\n",
ATH6KL_ABI_VERSION, ar->version.abi_ver);
^ permalink raw reply related
* [PATCH 2/4] ath6kl: add sdio debug messages
From: Kalle Valo @ 2011-09-27 11:30 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20110927113045.11592.15974.stgit@localhost6.localdomain6>
Add extensive debug messages to sdio.c. Makes it easier to debug
various problems.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/debug.h | 2 ++
drivers/net/wireless/ath/ath6kl/sdio.c | 36 +++++++++++++++++++++++--------
2 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index 3730e09..63eb1c1 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -36,6 +36,8 @@ enum ATH6K_DEBUG_MASK {
ATH6KL_DBG_WLAN_CFG = BIT(13), /* cfg80211 i/f file tracing */
ATH6KL_DBG_RAW_BYTES = BIT(14), /* dump tx/rx and wmi frames */
ATH6KL_DBG_AGGR = BIT(15), /* aggregation */
+ ATH6KL_DBG_SDIO = BIT(16),
+ ATH6KL_DBG_SDIO_DUMP = BIT(17),
ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */
};
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 4724ddf..f1dc311 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -135,10 +135,12 @@ static int ath6kl_sdio_io(struct sdio_func *func, u32 request, u32 addr,
int ret = 0;
if (request & HIF_WRITE) {
+ /* FIXME: looks like ugly workaround for something */
if (addr >= HIF_MBOX_BASE_ADDR &&
addr <= HIF_MBOX_END_ADDR)
addr += (HIF_MBOX_WIDTH - len);
+ /* FIXME: this also looks like ugly workaround */
if (addr == HIF_MBOX0_EXT_BASE_ADDR)
addr += HIF_MBOX0_EXT_WIDTH - len;
@@ -153,6 +155,11 @@ static int ath6kl_sdio_io(struct sdio_func *func, u32 request, u32 addr,
ret = sdio_memcpy_fromio(func, buf, addr, len);
}
+ ath6kl_dbg(ATH6KL_DBG_SDIO, "%s addr 0x%x%s buf 0x%p len %d\n",
+ request & HIF_WRITE ? "wr" : "rd", addr,
+ request & HIF_FIXED_ADDRESS ? " (fixed)" : "", buf, len);
+ ath6kl_dbg_dump(ATH6KL_DBG_SDIO_DUMP, NULL, "sdio ", buf, len);
+
return ret;
}
@@ -173,7 +180,8 @@ static struct bus_request *ath6kl_sdio_alloc_busreq(struct ath6kl_sdio *ar_sdio)
list_del(&bus_req->list);
spin_unlock_irqrestore(&ar_sdio->lock, flag);
- ath6kl_dbg(ATH6KL_DBG_TRC, "%s: bus request 0x%p\n", __func__, bus_req);
+ ath6kl_dbg(ATH6KL_DBG_SCATTER, "%s: bus request 0x%p\n",
+ __func__, bus_req);
return bus_req;
}
@@ -183,7 +191,8 @@ static void ath6kl_sdio_free_bus_req(struct ath6kl_sdio *ar_sdio,
{
unsigned long flag;
- ath6kl_dbg(ATH6KL_DBG_TRC, "%s: bus request 0x%p\n", __func__, bus_req);
+ ath6kl_dbg(ATH6KL_DBG_SCATTER, "%s: bus request 0x%p\n",
+ __func__, bus_req);
spin_lock_irqsave(&ar_sdio->lock, flag);
list_add_tail(&bus_req->list, &ar_sdio->bus_req_freeq);
@@ -438,6 +447,8 @@ static void ath6kl_sdio_irq_handler(struct sdio_func *func)
int status;
struct ath6kl_sdio *ar_sdio;
+ ath6kl_dbg(ATH6KL_DBG_SDIO, "irq\n");
+
ar_sdio = sdio_get_drvdata(func);
atomic_set(&ar_sdio->irq_handling, 1);
@@ -675,7 +686,7 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar)
MAX_SCATTER_REQUESTS, virt_scat);
if (!ret) {
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_SCATTER,
"hif-scatter enabled: max scatter req : %d entries: %d\n",
MAX_SCATTER_REQUESTS,
MAX_SCATTER_ENTRIES_PER_REQ);
@@ -700,7 +711,7 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar)
return ret;
}
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_SCATTER,
"Vitual scatter enabled, max_scat_req:%d, entries:%d\n",
ATH6KL_SCATTER_REQS, ATH6KL_SCATTER_ENTRIES_PER_REQ);
@@ -723,6 +734,9 @@ static int ath6kl_sdio_suspend(struct ath6kl *ar)
if (!(flags & MMC_PM_KEEP_POWER))
/* as host doesn't support keep power we need to bail out */
+ ath6kl_dbg(ATH6KL_DBG_SDIO,
+ "func %d doesn't support MMC_PM_KEEP_POWER\n",
+ func->num);
return -EINVAL;
ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
@@ -758,10 +772,10 @@ static int ath6kl_sdio_probe(struct sdio_func *func,
struct ath6kl *ar;
int count;
- ath6kl_dbg(ATH6KL_DBG_TRC,
- "%s: func: 0x%X, vendor id: 0x%X, dev id: 0x%X, block size: 0x%X/0x%X\n",
- __func__, func->num, func->vendor,
- func->device, func->max_blksize, func->cur_blksize);
+ ath6kl_dbg(ATH6KL_DBG_SDIO,
+ "new func %d vendor 0x%x device 0x%x block 0x%x/0x%x\n",
+ func->num, func->vendor, func->device,
+ func->max_blksize, func->cur_blksize);
ar_sdio = kzalloc(sizeof(struct ath6kl_sdio), GFP_KERNEL);
if (!ar_sdio)
@@ -820,7 +834,7 @@ static int ath6kl_sdio_probe(struct sdio_func *func,
goto err_cfg80211;
}
- ath6kl_dbg(ATH6KL_DBG_TRC, "4-bit async irq mode enabled\n");
+ ath6kl_dbg(ATH6KL_DBG_SDIO, "4-bit async irq mode enabled\n");
}
/* give us some time to enable, in ms */
@@ -868,6 +882,10 @@ static void ath6kl_sdio_remove(struct sdio_func *func)
{
struct ath6kl_sdio *ar_sdio;
+ ath6kl_dbg(ATH6KL_DBG_SDIO,
+ "removed func %d vendor 0x%x device 0x%x\n",
+ func->num, func->vendor, func->device);
+
ar_sdio = sdio_get_drvdata(func);
ath6kl_stop_txrx(ar_sdio->ar);
^ permalink raw reply related
* [PATCH 1/4] ath6kl: add prefix parameter to ath6kl_dbg_dump()
From: Kalle Valo @ 2011-09-27 11:30 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
Makes it easier to recognise longs dumps.
Obligatory screenshot using "rx" prefix:
ath6kl: ath6kl_rx
rx 00000000: 10 10 00 00 00 00 08 30 00 00 00 00 00 00 f9 0b .......0........
rx 00000010: 2c 44 08 30 00 00 f9 0b 0c a4 02 00 00 00 73 d2 ,D.0..........s.
rx 00000020: 94 00 f9 0b 04 8c 01 00 02 00 07 02 02 00 f9 0b ................
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/debug.h | 14 ++++++++------
drivers/net/wireless/ath/ath6kl/htc.c | 27 ++++++++++++++-------------
drivers/net/wireless/ath/ath6kl/txrx.c | 6 ++++--
drivers/net/wireless/ath/ath6kl/wmi.c | 3 ++-
4 files changed, 28 insertions(+), 22 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index 89bf8e1..3730e09 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -65,12 +65,14 @@ extern int ath6kl_printk(const char *level, const char *fmt, ...)
})
static inline void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
- const char *msg, const void *buf,
- size_t len)
+ const char *msg, const char *prefix,
+ const void *buf, size_t len)
{
if (debug_mask & mask) {
- ath6kl_dbg(mask, "%s\n", msg);
- print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf, len);
+ if (msg)
+ ath6kl_dbg(mask, "%s\n", msg);
+
+ print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len);
}
}
@@ -90,8 +92,8 @@ static inline int ath6kl_dbg(enum ATH6K_DEBUG_MASK dbg_mask,
}
static inline void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
- const char *msg, const void *buf,
- size_t len)
+ const char *msg, const char *prefix,
+ const void *buf, size_t len)
{
}
diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index feed985..f88a7c9 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -1192,9 +1192,9 @@ static void htc_ctrl_rx(struct htc_target *context, struct htc_packet *packets)
packets->act_len + HTC_HDR_LENGTH);
ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES,
- "Unexpected ENDPOINT 0 Message",
- packets->buf - HTC_HDR_LENGTH,
- packets->act_len + HTC_HDR_LENGTH);
+ "Unexpected ENDPOINT 0 Message", "",
+ packets->buf - HTC_HDR_LENGTH,
+ packets->act_len + HTC_HDR_LENGTH);
}
htc_reclaim_rxbuf(context, packets, &context->endpoint[0]);
@@ -1328,7 +1328,7 @@ static int htc_parse_trailer(struct htc_target *target,
memcpy((u8 *)&next_lk_ahds[0], lk_ahd->lk_ahd, 4);
ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Next Look Ahead",
- next_lk_ahds, 4);
+ "", next_lk_ahds, 4);
*n_lk_ahds = 1;
}
@@ -1347,7 +1347,7 @@ static int htc_parse_trailer(struct htc_target *target,
(struct htc_bundle_lkahd_rpt *) record_buf;
ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Bundle lk_ahd",
- record_buf, record->len);
+ "", record_buf, record->len);
for (i = 0; i < len; i++) {
memcpy((u8 *)&next_lk_ahds[i],
@@ -1380,7 +1380,8 @@ static int htc_proc_trailer(struct htc_target *target,
ath6kl_dbg(ATH6KL_DBG_HTC_RECV, "+htc_proc_trailer (len:%d)\n", len);
- ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Recv Trailer", buf, len);
+ ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Recv Trailer", "",
+ buf, len);
orig_buf = buf;
orig_len = len;
@@ -1418,7 +1419,7 @@ static int htc_proc_trailer(struct htc_target *target,
if (status)
ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "BAD Recv Trailer",
- orig_buf, orig_len);
+ "", orig_buf, orig_len);
return status;
}
@@ -1435,8 +1436,8 @@ static int ath6kl_htc_rx_process_hdr(struct htc_target *target,
if (n_lkahds != NULL)
*n_lkahds = 0;
- ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "HTC Recv PKT", packet->buf,
- packet->act_len);
+ ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "HTC Recv PKT", "htc ",
+ packet->buf, packet->act_len);
/*
* NOTE: we cannot assume the alignment of buf, so we use the safe
@@ -1480,9 +1481,9 @@ static int ath6kl_htc_rx_process_hdr(struct htc_target *target,
ath6kl_err("%s(): lk_ahd mismatch! (pPkt:0x%p flags:0x%X)\n",
__func__, packet, packet->info.rx.rx_flags);
ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Expected Message lk_ahd",
- &packet->info.rx.exp_hdr, 4);
+ "", &packet->info.rx.exp_hdr, 4);
ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Current Frame Header",
- (u8 *)&lk_ahd, sizeof(lk_ahd));
+ "", (u8 *)&lk_ahd, sizeof(lk_ahd));
status = -ENOMEM;
goto fail_rx;
}
@@ -1518,12 +1519,12 @@ static int ath6kl_htc_rx_process_hdr(struct htc_target *target,
fail_rx:
if (status)
ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "BAD HTC Recv PKT",
- packet->buf,
+ "", packet->buf,
packet->act_len < 256 ? packet->act_len : 256);
else {
if (packet->act_len > 0)
ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES,
- "HTC - Application Msg",
+ "HTC - Application Msg", "",
packet->buf, packet->act_len);
}
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index 348c646..bc65781 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -322,7 +322,8 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
set_htc_pkt_info(&cookie->htc_pkt, cookie, skb->data, skb->len,
eid, htc_tag);
- ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, __func__, skb->data, skb->len);
+ ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, __func__, "tx ",
+ skb->data, skb->len);
/*
* HTC interface is asynchronous, if this fails, cleanup will
@@ -1050,7 +1051,8 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
skb_put(skb, packet->act_len + HTC_HDR_LENGTH);
skb_pull(skb, HTC_HDR_LENGTH);
- ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, __func__, skb->data, skb->len);
+ ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, __func__, "rx ",
+ skb->data, skb->len);
skb->dev = ar->net_dev;
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 47fbb8e..785a8c7 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -2850,7 +2850,8 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb)
len = skb->len;
ath6kl_dbg(ATH6KL_DBG_WMI, "%s: wmi id: %d\n", __func__, id);
- ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "msg payload ", datap, len);
+ ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "msg payload ", "wmi rx ",
+ datap, len);
switch (id) {
case WMI_GET_BITRATE_CMDID:
^ permalink raw reply related
* [RFC] mac80211: remove per band sta supported rates
From: Stanislaw Gruszka @ 2011-09-27 11:12 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Stanislaw Gruszka
It is not possible to connect to remote station on two bands
at once, or I'm wrong?
As side effect this patch fix warning in
rate_control_send_low (or rather mask the real problem):
https://bugzilla.redhat.com/show_bug.cgi?id=731365
Which may happen when we are just after disassociation and changed
channel/band, but still want send some frames (namely delBA) to old
sta. Right fix should prevent to change channel before we fully
dissassocate, or prevent to send frames after connection is lost,
or both, but I don't know how to correctly do this so far.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 +-
drivers/net/wireless/ath/ath9k/rc.c | 2 +-
drivers/net/wireless/iwlegacy/iwl-3945-rs.c | 6 +++---
drivers/net/wireless/iwlegacy/iwl-4965-rs.c | 6 +++---
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 6 +++---
drivers/net/wireless/mwl8k.c | 13 ++++++-------
drivers/net/wireless/rtlwifi/core.c | 8 ++++----
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 8 ++++----
drivers/net/wireless/rtlwifi/rtl8192de/hw.c | 8 ++++----
drivers/net/wireless/rtlwifi/rtl8192se/hw.c | 8 ++++----
drivers/net/wireless/wl12xx/cmd.c | 2 +-
drivers/net/wireless/wl12xx/main.c | 2 +-
include/net/mac80211.h | 9 ++++-----
net/mac80211/cfg.c | 2 +-
net/mac80211/ibss.c | 8 ++++----
net/mac80211/mesh_plink.c | 4 ++--
net/mac80211/mlme.c | 2 +-
net/mac80211/rate.c | 2 +-
net/mac80211/rc80211_minstrel.c | 2 +-
net/mac80211/rc80211_pid_algo.c | 9 ++++-----
20 files changed, 53 insertions(+), 56 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 495fdf6..bc0af82 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -602,7 +602,7 @@ static void ath9k_htc_setup_rate(struct ath9k_htc_priv *priv,
sband = priv->hw->wiphy->bands[priv->hw->conf.channel->band];
for (i = 0, j = 0; i < sband->n_bitrates; i++) {
- if (sta->supp_rates[sband->band] & BIT(i)) {
+ if (sta->supp_rates & BIT(i)) {
trate->rates.legacy_rates.rs_rates[j]
= (sband->bitrates[i].bitrate * 2) / 10;
j++;
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 4f13018..6d264d5 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1406,7 +1406,7 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
int i, j = 0;
for (i = 0; i < sband->n_bitrates; i++) {
- if (sta->supp_rates[sband->band] & BIT(i)) {
+ if (sta->supp_rates & BIT(i)) {
ath_rc_priv->neg_rates.rs_rates[j]
= (sband->bitrates[i].bitrate * 2) / 10;
j++;
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
index 8faeaf2..0d65706 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
@@ -373,13 +373,13 @@ void iwl3945_rs_rate_init(struct iwl_priv *priv, struct ieee80211_sta *sta, u8 s
* after assoc.. */
for (i = sband->n_bitrates - 1; i >= 0; i--) {
- if (sta->supp_rates[sband->band] & (1 << i)) {
+ if (sta->supp_rates & (1 << i)) {
rs_sta->last_txrate_idx = i;
break;
}
}
- priv->_3945.sta_supp_rates = sta->supp_rates[sband->band];
+ priv->_3945.sta_supp_rates = sta->supp_rates;
/* For 5 GHz band it start at IWL_FIRST_OFDM_RATE */
if (sband->band == IEEE80211_BAND_5GHZ) {
rs_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE;
@@ -659,7 +659,7 @@ static void iwl3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
if (rate_control_send_low(sta, priv_sta, txrc))
return;
- rate_mask = sta->supp_rates[sband->band];
+ rate_mask = sta->supp_rates;
/* get user max rate if set */
max_rate_idx = txrc->max_rate_idx;
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-rs.c b/drivers/net/wireless/iwlegacy/iwl-4965-rs.c
index 57ebe21..d4731fc 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-rs.c
@@ -989,7 +989,7 @@ iwl4965_rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
lq_sta->last_rate_n_flags = tx_rate;
done:
/* See if there's a better rate or modulation mode to try. */
- if (sta && sta->supp_rates[sband->band])
+ if (sta && sta->supp_rates)
iwl4965_rs_rate_scale_perform(priv, skb, sta, lq_sta);
}
@@ -1794,7 +1794,7 @@ static void iwl4965_rs_rate_scale_perform(struct iwl_priv *priv,
if (!sta || !lq_sta)
return;
- lq_sta->supp_rates = sta->supp_rates[lq_sta->band];
+ lq_sta->supp_rates = sta->supp_rates;
tid = iwl4965_rs_tl_add_packet(lq_sta, hdr);
if ((tid != MAX_TID_COUNT) && (lq_sta->tx_agg_tid_en & (1 << tid))) {
@@ -2359,7 +2359,7 @@ iwl4965_rs_rate_init(struct iwl_priv *priv,
&lq_sta->lq_info[j].win[i]);
lq_sta->flush_timer = 0;
- lq_sta->supp_rates = sta->supp_rates[sband->band];
+ lq_sta->supp_rates = sta->supp_rates;
for (j = 0; j < LQ_SIZE; j++)
for (i = 0; i < IWL_RATE_COUNT; i++)
iwl4965_rs_rate_scale_clear_window(
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index c14f8d6..c2cb9f6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -1079,7 +1079,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
lq_sta->last_rate_n_flags = tx_rate;
done:
/* See if there's a better rate or modulation mode to try. */
- if (sta && sta->supp_rates[sband->band])
+ if (sta && sta->supp_rates)
rs_rate_scale_perform(priv, skb, sta, lq_sta);
#if defined(CONFIG_MAC80211_DEBUGFS) && defined(CONFIG_IWLWIFI_DEVICE_SVTOOL)
@@ -2276,7 +2276,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
if (!sta || !lq_sta)
return;
- lq_sta->supp_rates = sta->supp_rates[lq_sta->band];
+ lq_sta->supp_rates = sta->supp_rates;
tid = rs_tl_add_packet(lq_sta, hdr);
if ((tid != IWL_MAX_TID_COUNT) &&
@@ -2848,7 +2848,7 @@ void iwl_rs_rate_init(struct iwl_priv *priv, struct ieee80211_sta *sta, u8 sta_i
rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]);
lq_sta->flush_timer = 0;
- lq_sta->supp_rates = sta->supp_rates[sband->band];
+ lq_sta->supp_rates = sta->supp_rates;
for (j = 0; j < LQ_SIZE; j++)
for (i = 0; i < IWL_RATE_COUNT; i++)
rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]);
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index ea1395a..f6a82bd 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -3776,9 +3776,9 @@ static int mwl8k_cmd_set_new_stn_add(struct ieee80211_hw *hw,
cmd->stn_id = cpu_to_le16(sta->aid);
cmd->action = cpu_to_le16(MWL8K_STA_ACTION_ADD);
if (hw->conf.channel->band == IEEE80211_BAND_2GHZ)
- rates = sta->supp_rates[IEEE80211_BAND_2GHZ];
+ rates = sta->supp_rates;
else
- rates = sta->supp_rates[IEEE80211_BAND_5GHZ] << 5;
+ rates = sta->supp_rates << 5;
cmd->legacy_rates = cpu_to_le32(rates);
if (sta->ht_cap.ht_supported) {
cmd->ht_rates[0] = sta->ht_cap.mcs.rx_mask[0];
@@ -4187,9 +4187,9 @@ static int mwl8k_cmd_update_stadb_add(struct ieee80211_hw *hw,
p->extended_ht_caps = (sta->ht_cap.ampdu_factor & 3) |
((sta->ht_cap.ampdu_density & 7) << 2);
if (hw->conf.channel->band == IEEE80211_BAND_2GHZ)
- rates = sta->supp_rates[IEEE80211_BAND_2GHZ];
+ rates = sta->supp_rates;
else
- rates = sta->supp_rates[IEEE80211_BAND_5GHZ] << 5;
+ rates = sta->supp_rates << 5;
legacy_rate_mask_to_array(p->legacy_rates, rates);
memcpy(p->ht_rates, sta->ht_cap.mcs.rx_mask, 16);
p->interop = 1;
@@ -4601,10 +4601,9 @@ mwl8k_bss_info_changed_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
}
if (hw->conf.channel->band == IEEE80211_BAND_2GHZ) {
- ap_legacy_rates = ap->supp_rates[IEEE80211_BAND_2GHZ];
+ ap_legacy_rates = ap->supp_rates;
} else {
- ap_legacy_rates =
- ap->supp_rates[IEEE80211_BAND_5GHZ] << 5;
+ ap_legacy_rates = ap->supp_rates << 5;
}
memcpy(ap_mcs_rates, ap->ht_cap.mcs.rx_mask, 16);
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index 04c4e9e..67d0df2 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -441,7 +441,7 @@ static int rtl_op_sta_add(struct ieee80211_hw *hw,
sta_entry = (struct rtl_sta_info *) sta->drv_priv;
if (rtlhal->current_bandtype == BAND_ON_2_4G) {
sta_entry->wireless_mode = WIRELESS_MODE_G;
- if (sta->supp_rates[0] <= 0xf)
+ if (sta->supp_rates <= 0xf)
sta_entry->wireless_mode = WIRELESS_MODE_B;
if (sta->ht_cap.ht_supported)
sta_entry->wireless_mode = WIRELESS_MODE_N_24G;
@@ -699,7 +699,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
if (rtlhal->current_bandtype == BAND_ON_5G) {
mac->mode = WIRELESS_MODE_A;
} else {
- if (sta->supp_rates[0] <= 0xf)
+ if (sta->supp_rates <= 0xf)
mac->mode = WIRELESS_MODE_B;
else
mac->mode = WIRELESS_MODE_G;
@@ -735,9 +735,9 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
/* for 5G must << RATE_6M_INDEX=4,
* because 5G have no cck rate*/
if (rtlhal->current_bandtype == BAND_ON_5G)
- basic_rates = sta->supp_rates[1] << 4;
+ basic_rates = sta->supp_rates << 4;
else
- basic_rates = sta->supp_rates[0];
+ basic_rates = sta->supp_rates;
mac->basic_rates = basic_rates;
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_BASIC_RATE,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
index a3deaef..49fbea6 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
@@ -1721,9 +1721,9 @@ static void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw,
enum wireless_mode wirelessmode = mac->mode;
if (rtlhal->current_bandtype == BAND_ON_5G)
- ratr_value = sta->supp_rates[1] << 4;
+ ratr_value = sta->supp_rates << 4;
else
- ratr_value = sta->supp_rates[0];
+ ratr_value = sta->supp_rates;
ratr_value |= (sta->ht_cap.mcs.rx_mask[1] << 20 |
sta->ht_cap.mcs.rx_mask[0] << 12);
switch (wirelessmode) {
@@ -1825,9 +1825,9 @@ static void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw,
macid = sta->aid + 1;
if (rtlhal->current_bandtype == BAND_ON_5G)
- ratr_bitmap = sta->supp_rates[1] << 4;
+ ratr_bitmap = sta->supp_rates << 4;
else
- ratr_bitmap = sta->supp_rates[0];
+ ratr_bitmap = sta->supp_rates;
ratr_bitmap |= (sta->ht_cap.mcs.rx_mask[1] << 20 |
sta->ht_cap.mcs.rx_mask[0] << 12);
switch (wirelessmode) {
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
index 0073cf1..755af01 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
@@ -1902,9 +1902,9 @@ static void rtl92de_update_hal_rate_table(struct ieee80211_hw *hw,
enum wireless_mode wirelessmode = mac->mode;
if (rtlhal->current_bandtype == BAND_ON_5G)
- ratr_value = sta->supp_rates[1] << 4;
+ ratr_value = sta->supp_rates << 4;
else
- ratr_value = sta->supp_rates[0];
+ ratr_value = sta->supp_rates;
ratr_value |= (sta->ht_cap.mcs.rx_mask[1] << 20 |
sta->ht_cap.mcs.rx_mask[0] << 12);
switch (wirelessmode) {
@@ -1995,9 +1995,9 @@ static void rtl92de_update_hal_rate_mask(struct ieee80211_hw *hw,
macid = sta->aid + 1;
if (rtlhal->current_bandtype == BAND_ON_5G)
- ratr_bitmap = sta->supp_rates[1] << 4;
+ ratr_bitmap = sta->supp_rates << 4;
else
- ratr_bitmap = sta->supp_rates[0];
+ ratr_bitmap = sta->supp_rates;
ratr_bitmap |= (sta->ht_cap.mcs.rx_mask[1] << 20 |
sta->ht_cap.mcs.rx_mask[0] << 12);
switch (wirelessmode) {
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
index d59f66c..a48df97 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
@@ -1997,9 +1997,9 @@ static void rtl92se_update_hal_rate_table(struct ieee80211_hw *hw,
enum wireless_mode wirelessmode = mac->mode;
if (rtlhal->current_bandtype == BAND_ON_5G)
- ratr_value = sta->supp_rates[1] << 4;
+ ratr_value = sta->supp_rates << 4;
else
- ratr_value = sta->supp_rates[0];
+ ratr_value = sta->supp_rates;
ratr_value |= (sta->ht_cap.mcs.rx_mask[1] << 20 |
sta->ht_cap.mcs.rx_mask[0] << 12);
switch (wirelessmode) {
@@ -2111,9 +2111,9 @@ static void rtl92se_update_hal_rate_mask(struct ieee80211_hw *hw,
macid = sta->aid + 1;
if (rtlhal->current_bandtype == BAND_ON_5G)
- ratr_bitmap = sta->supp_rates[1] << 4;
+ ratr_bitmap = sta->supp_rates << 4;
else
- ratr_bitmap = sta->supp_rates[0];
+ ratr_bitmap = sta->supp_rates;
ratr_bitmap |= (sta->ht_cap.mcs.rx_mask[1] << 20 |
sta->ht_cap.mcs.rx_mask[0] << 12);
switch (wirelessmode) {
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index 084262f..7dc4c04 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -1437,7 +1437,7 @@ int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid)
else
cmd->psd_type[i] = WL1271_PSD_LEGACY;
- sta_rates = sta->supp_rates[wl->band];
+ sta_rates = sta->supp_rates;
if (sta->ht_cap.ht_supported)
sta_rates |= sta->ht_cap.mcs.rx_mask[0] << HW_HT_RATES_OFFSET;
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 680f558..69c5c41 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3340,7 +3340,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
goto sta_not_found;
/* save the supp_rates of the ap */
- sta_rate_set = sta->supp_rates[wl->hw->conf.channel->band];
+ sta_rate_set = sta->supp_rates;
if (sta->ht_cap.ht_supported)
sta_rate_set |=
(sta->ht_cap.mcs.rx_mask[0] << HW_HT_RATES_OFFSET);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c0f63fd..76bc230 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -960,7 +960,7 @@ enum set_key_cmd {
* @max_sp: max Service Period. Only valid if wme is supported.
*/
struct ieee80211_sta {
- u32 supp_rates[IEEE80211_NUM_BANDS];
+ u32 supp_rates;
u8 addr[ETH_ALEN];
u16 aid;
struct ieee80211_sta_ht_cap ht_cap;
@@ -3322,10 +3322,9 @@ struct rate_control_ops {
};
static inline int rate_supported(struct ieee80211_sta *sta,
- enum ieee80211_band band,
int index)
{
- return (sta == NULL || sta->supp_rates[band] & BIT(index));
+ return (sta == NULL || sta->supp_rates & BIT(index));
}
/**
@@ -3358,7 +3357,7 @@ rate_lowest_index(struct ieee80211_supported_band *sband,
int i;
for (i = 0; i < sband->n_bitrates; i++)
- if (rate_supported(sta, sband->band, i))
+ if (rate_supported(sta, i))
return i;
/* warn when we cannot find a rate. */
@@ -3374,7 +3373,7 @@ bool rate_usable_index_exists(struct ieee80211_supported_band *sband,
unsigned int i;
for (i = 0; i < sband->n_bitrates; i++)
- if (rate_supported(sta, sband->band, i))
+ if (rate_supported(sta, i))
return true;
return false;
}
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index b57ddf9..0c4649d 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -744,7 +744,7 @@ static void sta_apply_parameters(struct ieee80211_local *local,
rates |= BIT(j);
}
}
- sta->sta.supp_rates[local->oper_channel->band] = rates;
+ sta->sta.supp_rates = rates;
}
if (params->ht_capa)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 836b275..d787092 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -290,12 +290,12 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
if (sta) {
u32 prev_rates;
- prev_rates = sta->sta.supp_rates[band];
+ prev_rates = sta->sta.supp_rates;
/* make sure mandatory rates are always added */
- sta->sta.supp_rates[band] = supp_rates |
+ sta->sta.supp_rates = supp_rates |
ieee80211_mandatory_rates(local, band);
- if (sta->sta.supp_rates[band] != prev_rates) {
+ if (sta->sta.supp_rates != prev_rates) {
#ifdef CONFIG_MAC80211_IBSS_DEBUG
printk(KERN_DEBUG
"%s: updated supp_rates set "
@@ -455,7 +455,7 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
set_sta_flags(sta, WLAN_STA_AUTHORIZED);
/* make sure mandatory rates are always added */
- sta->sta.supp_rates[band] = supp_rates |
+ sta->sta.supp_rates = supp_rates |
ieee80211_mandatory_rates(local, band);
rate_control_rate_init(sta);
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 1213a23..8b1ceab 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -93,7 +93,7 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
return NULL;
sta->flags = WLAN_STA_AUTHORIZED | WLAN_STA_AUTH | WLAN_STA_WME;
- sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
+ sta->sta.supp_rates = rates;
rate_control_rate_init(sta);
return sta;
@@ -269,7 +269,7 @@ void mesh_neighbour_update(u8 *hw_addr, u32 rates,
}
sta->last_rx = jiffies;
- sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
+ sta->sta.supp_rates = rates;
if (mesh_peer_accepts_plinks(elems) &&
sta->plink_state == NL80211_PLINK_LISTEN &&
sdata->u.mesh.accepting_plinks &&
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 1a59fb6..58e961e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1555,7 +1555,7 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
}
}
- sta->sta.supp_rates[wk->chan->band] = rates;
+ sta->sta.supp_rates = rates;
sdata->vif.bss_conf.basic_rates = basic_rates;
/* cf. IEEE 802.11 9.2.12 */
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index 3d5a2cb..aa38625 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -331,7 +331,7 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata,
if (mask != (1 << txrc->sband->n_bitrates) - 1) {
if (sta) {
/* Filter out rates that the STA does not support */
- mask &= sta->sta.supp_rates[info->band];
+ mask &= sta->sta.supp_rates;
}
/*
* Make sure the rate index selected for each TX rate is
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index 58a8955..4565a3c 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -395,7 +395,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
unsigned int tx_time_single;
unsigned int cw = mp->cw_min;
- if (!rate_supported(sta, sband->band, i))
+ if (!rate_supported(sta, i))
continue;
n++;
memset(mr, 0, sizeof(*mr));
diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c
index aeda654..bb235b5 100644
--- a/net/mac80211/rc80211_pid_algo.c
+++ b/net/mac80211/rc80211_pid_algo.c
@@ -74,10 +74,9 @@ static void rate_control_pid_adjust_rate(struct ieee80211_supported_band *sband,
struct rc_pid_sta_info *spinfo, int adj,
struct rc_pid_rateinfo *rinfo)
{
- int cur_sorted, new_sorted, probe, tmp, n_bitrates, band;
+ int cur_sorted, new_sorted, probe, tmp, n_bitrates;
int cur = spinfo->txrate_idx;
- band = sband->band;
n_bitrates = sband->n_bitrates;
/* Map passed arguments to sorted values. */
@@ -96,19 +95,19 @@ static void rate_control_pid_adjust_rate(struct ieee80211_supported_band *sband,
/* Ensure that the rate decrease isn't disadvantageous. */
for (probe = cur_sorted; probe >= new_sorted; probe--)
if (rinfo[probe].diff <= rinfo[cur_sorted].diff &&
- rate_supported(sta, band, rinfo[probe].index))
+ rate_supported(sta, rinfo[probe].index))
tmp = probe;
} else {
/* Look for rate increase with zero (or below) cost. */
for (probe = new_sorted + 1; probe < n_bitrates; probe++)
if (rinfo[probe].diff <= rinfo[new_sorted].diff &&
- rate_supported(sta, band, rinfo[probe].index))
+ rate_supported(sta, rinfo[probe].index))
tmp = probe;
}
/* Fit the rate found to the nearest supported rate. */
do {
- if (rate_supported(sta, band, rinfo[tmp].index)) {
+ if (rate_supported(sta, rinfo[tmp].index)) {
spinfo->txrate_idx = rinfo[tmp].index;
break;
}
--
1.7.1
^ permalink raw reply related
* Re: Questions on ieee80211_frame_duration()
From: Johannes Berg @ 2011-09-27 11:10 UTC (permalink / raw)
To: Roland Vossen; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <4E81A098.9040708@broadcom.com>
Hi,
> in response to one of your brcm80211 review comments, I am trying to
> replace functions that calculate frame duration with Mac80211 counterparts.
>
> As such, I have a hard time grasping this function:
>
> http://lxr.free-electrons.com/source/net/mac80211/util.c#L108
>
> A couple of questions:
>
> a. The comment in the 'else' branch does not mention 802.11n, but I
> think it should. Agree ?
Yeah, the function predates 11n support, and it seems that all devices
that actually implement 11n don't need to calculate the duration in
software, so this was never updated.
> b. The long/short preamble choice applies to CCK rates only. But this
> function does not take that into account. Is that on purpose ?
>
> c. In 802.11n there are 4 preamble types possible:
> - long (CCK rates)
> - short (CCK rates)
> - green field
> - mixed mode
>
> The function does not seem to take the last two types into account.
> Should it ?
I suppose it needs to. I'd be happy if you would fix it :-)
johannes
^ permalink raw reply
* Re: [PATCH 1/1] rfkill: add module option to become inactive.
From: Johannes Berg @ 2011-09-27 11:08 UTC (permalink / raw)
To: Andrew V. Stepanov; +Cc: davem, linville, linux-wireless
In-Reply-To: <CAN8FffrZuGu63oL7ZL8EjjdNqBaPDU6KHuatwrbNB0SjffvaTg@mail.gmail.com>
On Tue, 2011-09-27 at 13:34 +0400, Andrew V. Stepanov wrote:
> On Tue, Sep 27, 2011 at 12:54 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Tue, 2011-09-27 at 12:46 +0400, Andrew V. Stepanov wrote:
> >
> >> I wan't to completely ignore events (state) of software\hardware rfkill buttons.
> >
> > Why would you ever want to do that? I can see that you might want to
> > ignore soft buttons, but you can use urfkilld for that. Ignoring hard
> > buttons is completely useless -- they will affect the device they're
> > wired up to *anyway*.
>
> No. That is not true.
>
> Hardware rfkill button doesn't have any action to wlan\bluetooth
> devices on ThinkPad x201i with "CONFIG_RFKILL is not set".
> I can assume this is true for other notebooks.
Then why is it a hard button instead of the soft button on a separate
platform device?
johannes
^ permalink raw reply
* Questions on ieee80211_frame_duration()
From: Roland Vossen @ 2011-09-27 10:08 UTC (permalink / raw)
To: johannes Berg; +Cc: linux-wireless@vger.kernel.org
Hello Johannes,
in response to one of your brcm80211 review comments, I am trying to
replace functions that calculate frame duration with Mac80211 counterparts.
As such, I have a hard time grasping this function:
http://lxr.free-electrons.com/source/net/mac80211/util.c#L108
A couple of questions:
a. The comment in the 'else' branch does not mention 802.11n, but I
think it should. Agree ?
b. The long/short preamble choice applies to CCK rates only. But this
function does not take that into account. Is that on purpose ?
c. In 802.11n there are 4 preamble types possible:
- long (CCK rates)
- short (CCK rates)
- green field
- mixed mode
The function does not seem to take the last two types into account.
Should it ?
Bye, Roland.
^ permalink raw reply
* Re: [PATCH 09/20] staging: brcm80211: use endian annotated structures in brcmsmac
From: Arend van Spriel @ 2011-09-27 9:54 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Franky (Zhenhui) Lin, devel@linuxdriverproject.org,
gregkh@suse.de, linux-wireless@vger.kernel.org
In-Reply-To: <CACna6rzWVxDvRTFGPwG+c4a+YrpsCPoXBZc80G2Wvbt8ebpb9Q@mail.gmail.com>
On 09/26/2011 11:06 PM, Rafał Miłecki wrote:
> 2011/9/24 Franky Lin<frankyl@broadcom.com>:
>> @@ -1392,20 +1407,21 @@ struct d11rxhdr {
>> u16 RxStatus2;
>> u16 RxTSFTime;
>> u16 RxChan;
>> -} __packed;
>> +};
> Is this on purpose? Is this safe?
Hi Rafał,
This is indeed on purpose as this structure is aligned (no gaps)
properly because the members are all u16 and not going over the host
bus. However, it is used in a union with the little-endian version which
is packed. Based on feedback regarding that union this patch needs some
rework so it will be resend.
Gr. AvS
^ permalink raw reply
* Re: [PATCH 1/1] rfkill: add module option to become inactive.
From: Andrew V. Stepanov @ 2011-09-27 9:34 UTC (permalink / raw)
To: Johannes Berg; +Cc: davem, linville, linux-wireless
In-Reply-To: <1317113699.4082.7.camel@jlt3.sipsolutions.net>
On Tue, Sep 27, 2011 at 12:54 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Tue, 2011-09-27 at 12:46 +0400, Andrew V. Stepanov wrote:
>
>> I wan't to completely ignore events (state) of software\hardware rfkill buttons.
>
> Why would you ever want to do that? I can see that you might want to
> ignore soft buttons, but you can use urfkilld for that. Ignoring hard
> buttons is completely useless -- they will affect the device they're
> wired up to *anyway*.
No. That is not true.
Hardware rfkill button doesn't have any action to wlan\bluetooth
devices on ThinkPad x201i with "CONFIG_RFKILL is not set".
I can assume this is true for other notebooks.
>
> johannes
>
^ permalink raw reply
* Re: [PATCH 1/1] rfkill: add module option to become inactive.
From: Johannes Berg @ 2011-09-27 8:54 UTC (permalink / raw)
To: Andrew V. Stepanov; +Cc: davem, linville, linux-wireless
In-Reply-To: <CAN8FffqjeurgAvVHtMExgeAyBHRWznYBz2c043jcZgOmqw6TVg@mail.gmail.com>
On Tue, 2011-09-27 at 12:46 +0400, Andrew V. Stepanov wrote:
> I wan't to completely ignore events (state) of software\hardware rfkill buttons.
Why would you ever want to do that? I can see that you might want to
ignore soft buttons, but you can use urfkilld for that. Ignoring hard
buttons is completely useless -- they will affect the device they're
wired up to *anyway*.
johannes
^ permalink raw reply
* Re: [PATCH 1/1] rfkill: add module option to become inactive.
From: Andrew V. Stepanov @ 2011-09-27 8:46 UTC (permalink / raw)
To: Johannes Berg; +Cc: davem, linville, linux-wireless
In-Reply-To: <1317110884.4082.5.camel@jlt3.sipsolutions.net>
On Tue, Sep 27, 2011 at 12:08 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Tue, 2011-09-27 at 12:03 +0400, Andrew V. Stepanov wrote:
>> On Tue, Sep 27, 2011 at 11:46 AM, Johannes Berg
>> <johannes@sipsolutions.net> wrote:
>> > On Tue, 2011-09-27 at 14:33 +0400, Andrew V. Stepanov wrote:
>> >> From: Andriy Stepanov <stanv@altlinux.ru>
>> >>
>> >> Use as:
>> >> modprobe rfkill unblocked=1
>> >> or
>> >> /etc/modprobe.d/options
>> >> options rfkill unblocked=1
>> >
>> > Apart from the obvious style problems in this patch (tons of extra
>> > braces) I'm not convinced this is a good idea.
>> >
>> > What problem does it solve? Why can that problem not be solved
>> > differently with existing mechanisms (e.g. urfkilld configured to do
>> > nothing)?
>
>> 2. urfkilld can't be used to ignore Hard blocked buttons.
>
> Oh that's a good point -- so NACK on the patch.
>
> You *can't* ignore hard block buttons. All you can ignore is events from
> them, which is definitely not useful.
>
> johannes
>
>
I wan't to completely ignore events (state) of software\hardware rfkill buttons.
One solution for this, is to compile Linux kernel with "CONFIG_RFKILLL
is no net".
Than hardware/software rfkill buttons dosn't have any action to wlan-interfaces.
Other method is use this patch.
Do you know third method ?
^ permalink raw reply
* Re: [PATCH 1/1] rfkill: add module option to become inactive.
From: Johannes Berg @ 2011-09-27 8:08 UTC (permalink / raw)
To: Andrew V. Stepanov; +Cc: davem, linville, linux-wireless
In-Reply-To: <CAN8FffqH=x+qWnz=YJzatbW-b3aOgoivazH6Nb5SpsGt4Q6hGg@mail.gmail.com>
On Tue, 2011-09-27 at 12:03 +0400, Andrew V. Stepanov wrote:
> On Tue, Sep 27, 2011 at 11:46 AM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Tue, 2011-09-27 at 14:33 +0400, Andrew V. Stepanov wrote:
> >> From: Andriy Stepanov <stanv@altlinux.ru>
> >>
> >> Use as:
> >> modprobe rfkill unblocked=1
> >> or
> >> /etc/modprobe.d/options
> >> options rfkill unblocked=1
> >
> > Apart from the obvious style problems in this patch (tons of extra
> > braces) I'm not convinced this is a good idea.
> >
> > What problem does it solve? Why can that problem not be solved
> > differently with existing mechanisms (e.g. urfkilld configured to do
> > nothing)?
> 2. urfkilld can't be used to ignore Hard blocked buttons.
Oh that's a good point -- so NACK on the patch.
You *can't* ignore hard block buttons. All you can ignore is events from
them, which is definitely not useful.
johannes
^ permalink raw reply
* [PATCH] ath6kl: allow firmware to override firmware patch address
From: Kalle Valo @ 2011-09-27 8:05 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In some firmware versions their patch address has changed. If the firmware
provides one, use it to override the default address.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/core.h | 1 +
drivers/net/wireless/ath/ath6kl/init.c | 7 +++++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 82be42f..9ecf22b 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -69,6 +69,7 @@ enum ath6kl_fw_ie_type {
ATH6KL_FW_IE_PATCH_IMAGE = 4,
ATH6KL_FW_IE_RESERVED_RAM_SIZE = 5,
ATH6KL_FW_IE_CAPABILITIES = 6,
+ ATH6KL_FW_IE_PATCH_ADDR = 7,
};
enum ath6kl_fw_capability {
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 80c532d..e9785fe 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1000,6 +1000,13 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
__set_bit(i, ar->fw_capabilities);
}
break;
+ case ATH6KL_FW_IE_PATCH_ADDR:
+ if (ie_len != sizeof(*val))
+ break;
+
+ val = (__le32 *) data;
+ ar->hw.dataset_patch_addr = le32_to_cpup(val);
+ break;
default:
ath6kl_dbg(ATH6KL_DBG_TRC, "Unknown fw ie: %u\n",
le32_to_cpup(&hdr->id));
^ permalink raw reply related
* Re: [PATCH 1/1] rfkill: add module option to become inactive.
From: Andrew V. Stepanov @ 2011-09-27 8:03 UTC (permalink / raw)
To: Johannes Berg; +Cc: davem, linville, linux-wireless
In-Reply-To: <1317109617.4082.0.camel@jlt3.sipsolutions.net>
On Tue, Sep 27, 2011 at 11:46 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Tue, 2011-09-27 at 14:33 +0400, Andrew V. Stepanov wrote:
>> From: Andriy Stepanov <stanv@altlinux.ru>
>>
>> Use as:
>> modprobe rfkill unblocked=1
>> or
>> /etc/modprobe.d/options
>> options rfkill unblocked=1
>
> Apart from the obvious style problems in this patch (tons of extra
> braces) I'm not convinced this is a good idea.
>
> What problem does it solve? Why can that problem not be solved
> differently with existing mechanisms (e.g. urfkilld configured to do
> nothing)?
>
> johannes
>
1. I can remove extra braces.
2. urfkilld can't be used to ignore Hard blocked buttons.
^ permalink raw reply
* [PATCH] ath6kl: fix TCP corruption
From: Kalle Valo @ 2011-09-27 8:00 UTC (permalink / raw)
To: linux-wireless
From: Jouni Malinen <jouni@qca.qualcomm.com>
Commit 94e532d1a ("ath6kl: Fix system freeze under heavy data load")
aligns the skb data without checking if the skb is cloned. Because of
this ath6kl can corrupt the local TCP stack information that can result
in TCP retransmission failing and TCP connections stalling.
To avoid the corruption we need to copy the skb. Now the alignment
in ath6kl_htc_tx_buf_align() doesn't corrupt TCP packets anymore (and is
not even used for the cloned skb's that got copied since the alignment
of the data is handled at the copy time).
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/txrx.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index 348c646..0869ff3 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -317,6 +317,24 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
spin_unlock_bh(&ar->lock);
+ if (!IS_ALIGNED((unsigned long) skb->data - HTC_HDR_LENGTH, 4) &&
+ skb_cloned(skb)) {
+ /*
+ * We will touch (move the buffer data to align it. Since the
+ * skb buffer is cloned and not only the header is changed, we
+ * have to copy it to allow the changes. Since we are copying
+ * the data here, we may as well align it by reserving suitable
+ * headroom to avoid the memmove in ath6kl_htc_tx_buf_align().
+ */
+ struct sk_buff *nskb;
+
+ nskb = skb_copy_expand(skb, HTC_HDR_LENGTH, 0, GFP_ATOMIC);
+ if (nskb == NULL)
+ goto fail_tx;
+ kfree_skb(skb);
+ skb = nskb;
+ }
+
cookie->skb = skb;
cookie->map_no = map_no;
set_htc_pkt_info(&cookie->htc_pkt, cookie, skb->data, skb->len,
^ permalink raw reply related
* Re: Fwd: [PATCH 16/20] staging: brcm80211: declared global vars in softmac phy as const
From: Roland Vossen @ 2011-09-27 7:52 UTC (permalink / raw)
To: jak
Cc: Franky (Zhenhui) Lin, gregkh@suse.de,
devel@linuxdriverproject.org, linux-wireless@vger.kernel.org
In-Reply-To: <4E80B37C.4060106@broadcom.com>
Hello Julian,
>> diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c
>> index 15c5ffc..1b11b2f 100644
>> --- a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c
>> +++ b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c
>> @@ -1611,7 +1611,7 @@ const u32 dot11lcnphytbl_rx_gain_info_sz_rev0 =
>> sizeof(dot11lcnphytbl_rx_gain_info_rev0) /
>> sizeof(dot11lcnphytbl_rx_gain_info_rev0[0]);
>>
>> -static const u32 dot11lcnphytbl_rx_gain_info_sz_rev1 =
>> +const u32 dot11lcnphytbl_rx_gain_info_sz_rev1 =
>> sizeof(dot11lcnphytbl_rx_gain_info_rev1) /
>> sizeof(dot11lcnphytbl_rx_gain_info_rev1[0]);
>
> That seems like an anomaly. In a commit that is supposed
> to declare variables as const, the linkage of a variable
> changed.
The name of this commit could have been better. It should have been
'fixed sparse warnings on variable usage in softmac phy'. For what it is
worth: this variable is deleted in a later commit.
> Likewise, the removal of extern global variable
> declarations in phy_int.h also does not seem to belong
> here.
Agree.
The whole patch series will be resent anyway, let me split this commit
up in two to address your feedback.
Thanks, Roland.
^ permalink raw reply
* Re: [RFC 03/15] mac80211: also expire filtered frames
From: Johannes Berg @ 2011-09-27 7:50 UTC (permalink / raw)
To: Adrian Chadd; +Cc: Luis R. Rodriguez, linux-wireless
In-Reply-To: <CAJ-Vmo=9MUaKph=EXwF2VnE+=nHg4s=j=qhR2jnwa-xsXMno7g@mail.gmail.com>
On Tue, 2011-09-27 at 10:26 +0800, Adrian Chadd wrote:
> On 27 September 2011 06:30, Luis R. Rodriguez <mcgrof@frijolero.org> wrote:
>
> > No particular comments on the code yet but latency issues has got me
> > thinking about the filtered frames stuff and if we really need it. How
> > much benefit does keeping these frames give us instead of just
> > dropping them?
>
> Do you guys keep statistics about this sort of thing?
Not sure.
> My macbook pro ends up causing my FreeBSD AP to miss TX'ing a lot of
> frames, even if it's close by. This only occurs when it's on battery
> power.
>
> I have a feeling it's going to be doing aggressiveish power saving
> stuff and this'll be fixed by me porting over and tidying up the
> filtered frames support.
I'm surprised you don't have filtered frames support! It's pretty
important unless you keep hardware queues almost empty since otherwise
exactly what you describe will happen. The hardware is supposed to keep
track of when a station goes to sleep (only WAKE->DOZE transition, must
rely on driver/stack for DOZE->WAKE transition to avoid packet
reordering) and reject ("filter") frames on the queue in that case.
johannes
^ permalink raw reply
* Re: [RFC 03/15] mac80211: also expire filtered frames
From: Johannes Berg @ 2011-09-27 7:47 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: linux-wireless
In-Reply-To: <CAB=NE6UP9xYmLY3nJRMVdjPky87hB1YzFTHEzBv0Pt=qv3kAmg@mail.gmail.com>
On Mon, 2011-09-26 at 15:30 -0700, Luis R. Rodriguez wrote:
> No particular comments on the code yet but latency issues has got me
> thinking about the filtered frames stuff and if we really need it. How
> much benefit does keeping these frames give us instead of just
> dropping them?
If the station goes to sleep, it'll incur latency by design. The
filtered frames stuff is really just a way to close the race between
giving a packet to the device and the station going to sleep -- as such
I think we should really keep it.
johannes
^ permalink raw reply
* Re: [PATCH 1/1] rfkill: add module option to become inactive.
From: Johannes Berg @ 2011-09-27 7:46 UTC (permalink / raw)
To: Andrew V. Stepanov; +Cc: davem, linville, linux-wireless, Andriy Stepanov
In-Reply-To: <1317119624-2974-1-git-send-email-stanv@altlinux.org>
On Tue, 2011-09-27 at 14:33 +0400, Andrew V. Stepanov wrote:
> From: Andriy Stepanov <stanv@altlinux.ru>
>
> Use as:
> modprobe rfkill unblocked=1
> or
> /etc/modprobe.d/options
> options rfkill unblocked=1
Apart from the obvious style problems in this patch (tons of extra
braces) I'm not convinced this is a good idea.
What problem does it solve? Why can that problem not be solved
differently with existing mechanisms (e.g. urfkilld configured to do
nothing)?
johannes
^ permalink raw reply
* Re: [PATCH] ath6kl: Remove unnecessary retrieval of first list entry in ath6kl_htc_tx_setup_scat_list()
From: Kalle Valo @ 2011-09-27 7:21 UTC (permalink / raw)
To: Vasanthakumar Thiagarajan; +Cc: linux-wireless
In-Reply-To: <1317028743-18092-1-git-send-email-vthiagar@qca.qualcomm.com>
On 09/26/2011 12:19 PM, Vasanthakumar Thiagarajan wrote:
> It is unnecessary to take the first list entry from queue again for
> transmission. Sometimes it may look racy when the head of the list
> changes between subsequent retrival, but should not happen in
> practical.
Thanks, applied.
Kalle
^ permalink raw reply
* Re: [PATCH] ath6kl: Fix compilation error while compiling w/o debug
From: Kalle Valo @ 2011-09-27 7:17 UTC (permalink / raw)
To: Rajkumar Manoharan; +Cc: linville, linux-wireless
In-Reply-To: <1317027558-2691-1-git-send-email-rmanohar@qca.qualcomm.com>
On 09/26/2011 11:59 AM, Rajkumar Manoharan wrote:
> drivers/net/wireless/ath/ath6kl/htc_hif.o:
> In function `ath6kl_debug_fwlog_event':
> drivers/net/wireless/ath/ath6kl/debug.h:109:
> multiple definition of `ath6kl_debug_fwlog_event'
> drivers/net/wireless/ath/ath6kl/debug.o:
> drivers/net/wireless/ath/ath6kl/debug.h:109: first defined here
> drivers/net/wireless/ath/ath6kl/htc_hif.o:
> In function `ath6kl_debug_cleanup':
> drivers/net/wireless/ath/ath6kl/debug.h:118:
> multiple definition of `ath6kl_debug_cleanup'
> drivers/net/wireless/ath/ath6kl/debug.o:
> drivers/net/wireless/ath/ath6kl/debug.h:118: first defined here
I broke this, thank you for fixing it. Patch applied.
Kalle
^ permalink raw reply
* [PATCH 1/1] rfkill: add module option to become inactive.
From: Andrew V. Stepanov @ 2011-09-27 10:33 UTC (permalink / raw)
To: davem, johannes, linville; +Cc: linux-wireless, Andriy Stepanov
From: Andriy Stepanov <stanv@altlinux.ru>
Use as:
modprobe rfkill unblocked=1
or
/etc/modprobe.d/options
options rfkill unblocked=1
Signed-off-by: Andriy Stepanov <stanv@altlinux.ru>
---
net/rfkill/core.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index be90640..9d9014a 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -47,6 +47,10 @@
RFKILL_BLOCK_SW_PREV)
#define RFKILL_BLOCK_SW_SETCALL BIT(31)
+int rfkill_unblocked;
+module_param_named(unblocked, rfkill_unblocked, int, 0);
+MODULE_PARM_DESC(unblocked, "rfkill subsystem become inactive.");
+
struct rfkill {
spinlock_t lock;
@@ -455,6 +459,10 @@ bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked)
{
bool ret, change;
+ if (rfkill_unblocked) {
+ return blocked;
+ }
+
ret = __rfkill_set_hw_state(rfkill, blocked, &change);
if (!rfkill->registered)
@@ -486,6 +494,10 @@ bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked)
unsigned long flags;
bool prev, hwblock;
+ if (rfkill_unblocked) {
+ return blocked;
+ }
+
BUG_ON(!rfkill);
spin_lock_irqsave(&rfkill->lock, flags);
@@ -511,6 +523,10 @@ void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked)
{
unsigned long flags;
+ if (rfkill_unblocked) {
+ return;
+ }
+
BUG_ON(!rfkill);
BUG_ON(rfkill->registered);
@@ -526,6 +542,10 @@ void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw)
unsigned long flags;
bool swprev, hwprev;
+ if (rfkill_unblocked) {
+ return;
+ }
+
BUG_ON(!rfkill);
spin_lock_irqsave(&rfkill->lock, flags);
@@ -760,6 +780,10 @@ static int rfkill_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
void rfkill_pause_polling(struct rfkill *rfkill)
{
+ if (rfkill_unblocked) {
+ return;
+ }
+
BUG_ON(!rfkill);
if (!rfkill->ops->poll)
@@ -771,6 +795,10 @@ EXPORT_SYMBOL(rfkill_pause_polling);
void rfkill_resume_polling(struct rfkill *rfkill)
{
+ if (rfkill_unblocked) {
+ return;
+ }
+
BUG_ON(!rfkill);
if (!rfkill->ops->poll)
@@ -818,6 +846,10 @@ bool rfkill_blocked(struct rfkill *rfkill)
unsigned long flags;
u32 state;
+ if (rfkill_unblocked) {
+ return false;
+ }
+
spin_lock_irqsave(&rfkill->lock, flags);
state = rfkill->state;
spin_unlock_irqrestore(&rfkill->lock, flags);
@@ -836,6 +868,11 @@ struct rfkill * __must_check rfkill_alloc(const char *name,
struct rfkill *rfkill;
struct device *dev;
+ if (rfkill_unblocked) {
+ printk(KERN_DEBUG "rfkill: ignore object allocation.\n");
+ return ERR_PTR(-ENODEV);
+ }
+
if (WARN_ON(!ops))
return NULL;
@@ -915,6 +952,14 @@ int __must_check rfkill_register(struct rfkill *rfkill)
struct device *dev = &rfkill->dev;
int error;
+ if (rfkill_unblocked) {
+ if (rfkill == ERR_PTR(-ENODEV)) {
+ return 0;
+ } else {
+ return -EINVAL;
+ }
+ }
+
BUG_ON(!rfkill);
mutex_lock(&rfkill_global_mutex);
@@ -978,6 +1023,10 @@ void rfkill_unregister(struct rfkill *rfkill)
{
BUG_ON(!rfkill);
+ if (rfkill_unblocked) {
+ return;
+ }
+
if (rfkill->ops->poll)
cancel_delayed_work_sync(&rfkill->poll_work);
@@ -999,6 +1048,11 @@ EXPORT_SYMBOL(rfkill_unregister);
void rfkill_destroy(struct rfkill *rfkill)
{
+
+ if (rfkill_unblocked) {
+ return;
+ }
+
if (rfkill)
put_device(&rfkill->dev);
}
--
1.7.4.4
^ permalink raw reply related
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