From: Luciano Coelho <coelho@ti.com>
To: Eliad Peller <eliad@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 18/40] wl12xx: replace dummy_join with ROC/CROC commands
Date: Wed, 10 Aug 2011 17:31:38 +0300 [thread overview]
Message-ID: <1312986698.2407.668.camel@cumari> (raw)
In-Reply-To: <1312881233-9366-19-git-send-email-eliad@wizery.com>
On Tue, 2011-08-09 at 12:13 +0300, Eliad Peller wrote:
> The ROC command asks the fw stay on the channel of the given
> hlid. it currently has 2 primary functions:
>
> 1. Allow tx/rx from the device role.
>
> In order to tx/rx packets while the stations is not associated
> (e.g. auth req/resp), the device role has to be used, along
> with ROC on its link.
>
> Keep the logic similiar to the one used in dummy_join. However,
> since we can't scan while we ROC, we add CROC before starting
> a scan, and ROC again (if needed) on scan complete.
>
> 2. Keeping the antenna for a specific link.
>
> We ROC until the connection was completed (after EAPOLs exchange)
> in order to prevent BT coex operations from taking the antenna
> and failing the connection (after this stage, psm can be used).
>
> During association, we ROC on the station role, and then CROC
> the device role, thus assuring being ROC during all the connection
> process.
Nice explanations. I was wondering if we should have this somewhere in
the code too, so that it's easier to figure out what is going on without
digging into git logs...
> Replace the WL1271_FLAG_JOINED with a new WL1271_FLAG_ROC,
> indicating the fw was configured to ROC. Add a roc bitmap
> to indicate what roles are currently ROCed.
Is it really possible to be ROCed in more than one role? They could be
running on different channels, so how could we physically ROC more than
once at the same time?
> Add wl1271_roc/croc functions in order to wrap the roc/croc
> commands while taking care of the roc bitmap.
>
> The current ROC/CROC state-machine is a bit complicated. In
> the future we'll probably want to use wpa_supplicant to control
> the ROC during connection.
But when we have multirole, we may have several instances of
wpa_supplicant/hostap running, so there may be some conflicts of
interest there. I think it's better to keep ROCing in a centralized
place (ie. the driver).
> diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
> index 3091351..918c46b 100644
> --- a/drivers/net/wireless/wl12xx/cmd.c
> +++ b/drivers/net/wireless/wl12xx/cmd.c
> @@ -1484,13 +1484,13 @@ out:
>
> static int wl1271_cmd_roc(struct wl1271 *wl, u8 role_id)
> {
> struct wl1271_cmd_roc *cmd;
> int ret = 0;
>
> - wl1271_debug(DEBUG_CMD, "cmd roc %d (%d)", wl->channel, wl->band);
> + wl1271_debug(DEBUG_CMD, "cmd roc %d (%d)", wl->channel, role_id);
>
> if (WARN_ON(role_id == WL1271_INVALID_ROLE_ID))
> return -EINVAL;
>
> cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
> if (!cmd) {
> @@ -1526,22 +1526,23 @@ out_free:
> out:
> return ret;
> }
>
> static int wl1271_cmd_croc(struct wl1271 *wl, u8 role_id)
> {
> - struct wl1271_cmd_header *cmd;
> + struct wl1271_cmd_croc *cmd;
> int ret = 0;
>
> - wl1271_debug(DEBUG_CMD, "cmd croc");
> + wl1271_debug(DEBUG_CMD, "cmd croc (%d)", role_id);
>
> cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
> if (!cmd) {
> ret = -ENOMEM;
> goto out;
> }
> + cmd->role_id = role_id;
>
> ret = wl1271_cmd_send(wl, CMD_CANCEL_REMAIN_ON_CHANNEL, cmd,
> sizeof(*cmd), 0);
> if (ret < 0) {
> wl1271_error("failed to send ROC command");
> goto out_free;
Could you squash the changes to these two commands into the previous
patch?
> +int wl1271_roc(struct wl1271 *wl, u8 role_id)
> +{
> + int ret = 0;
> +
> + if (WARN_ON(test_bit(role_id, wl->roc_map)))
> + return 0;
> +
> + ret = wl1271_cmd_roc(wl, role_id);
> + if (ret < 0)
> + goto out;
> +
> + ret = wl1271_cmd_wait_for_event(wl,
> + REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID);
> + if (ret < 0) {
> + wl1271_error("cmd roc event completion error");
> + goto out;
> + }
> +
> + __set_bit(role_id, wl->roc_map);
> + set_bit(WL1271_FLAG_ROC, &wl->flags);
As I asked before, can we really be ROCed in more than one role at the
same time?
In any case, I don't think we need the WL1271_FLAG_ROC. Can't you just
check whether any of the roc_map bits is set instead?
> @@ -579,12 +581,19 @@ struct wl1271_cmd_roc {
> u8 role_id;
> u8 channel;
> u8 band;
> u8 padding;
> };
>
> +struct wl1271_cmd_croc {
> + struct wl1271_cmd_header header;
> +
> + u8 role_id;
> + u8 padding[3];
> +};
> +
Squash this one into patch 17 too, please.
> @@ -2211,24 +2196,23 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, bool idle)
> wl, CMD_TEMPL_KLV_IDX_NULL_DATA,
> ACX_KEEP_ALIVE_TPL_INVALID);
> if (ret < 0)
> goto out;
> set_bit(WL1271_FLAG_IDLE, &wl->flags);
> } else {
> - /* increment the session counter */
> - wl->session_counter++;
> - if (wl->session_counter >= SESSION_COUNTER_MAX)
> - wl->session_counter = 0;
> -
Shouldn't this be session_counter change be squashed into patch 21?
> @@ -2762,16 +2769,26 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw,
> }
>
> ret = wl1271_ps_elp_wakeup(wl);
> if (ret < 0)
> goto out;
>
> - ret = wl1271_scan(hw->priv, ssid, len, req);
> + /* cancel ROC before scanning */
> + if (test_bit(WL1271_FLAG_ROC, &wl->flags)) {
> + if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) {
> + /* don't allow scanning right now (?) */
> + ret = -EBUSY;
> + goto out_sleep;
> + }
This would happen in the case of roaming, right? Please add a TODO or
FIXME instead of the (?) so that it's easier to grep later. ;)
> @@ -3378,13 +3421,35 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
> if (do_join) {
> ret = wl1271_join(wl, set_assoc);
> if (ret < 0) {
> wl1271_warning("cmd join failed %d", ret);
> goto out;
> }
> - wl1271_check_operstate(wl, ieee80211_get_operstate(vif));
> +
> + /* ROC until interface is up (after EAPOL exchange) */
Do you mean, "ROC until connected"?
> + if (!is_ibss) {
> + ret = wl1271_roc(wl, wl->role_id);
> + if (ret < 0)
> + goto out;
> +
> + wl1271_check_operstate(wl,
> + ieee80211_get_operstate(vif));
> + }
--
Cheers,
Luca.
next prev parent reply other threads:[~2011-08-10 14:31 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-09 9:13 [PATCH 00/40] wl12xx: move to wl12xx-fw-3 Eliad Peller
2011-08-09 9:13 ` [PATCH 01/40] wl12xx: Revert "wl12xx: schedule TX packets according to FW occupancy" Eliad Peller
2011-08-09 11:54 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 02/40] wl12xx: Use a single fw for both STA and AP roles Eliad Peller
2011-08-09 11:59 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 03/40] wl12xx: use 1 spare block in all cases Eliad Peller
2011-08-09 12:03 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 04/40] wl12xx: temporarily disable 11n and advanced ap functions Eliad Peller
2011-08-09 12:49 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 05/40] wl12xx: remove rx filtering stuff Eliad Peller
2011-08-09 13:19 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 06/40] wl12xx: wl12xx-fw-3 - Update fw status struct Eliad Peller
2011-08-09 13:37 ` Luciano Coelho
2011-08-09 19:12 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 07/40] wl12xx: wl12xx-fw-3 - update acx commands Eliad Peller
2011-08-09 19:29 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 08/40] wl12xx: wl12xx-fw-3 - update commands & events Eliad Peller
2011-08-10 9:19 ` Luciano Coelho
2011-08-10 9:53 ` Eliad Peller
2011-08-10 10:26 ` Luciano Coelho
2011-08-10 10:24 ` Eliad Peller
2011-08-10 10:27 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 09/40] wl12xx: enable/disable role on interface add/remove Eliad Peller
2011-08-10 11:32 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 10/40] wl12xx: add device role commands Eliad Peller
2011-08-10 11:54 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 11/40] wl12xx: wl12xx-fw-3 - update scan cmd api Eliad Peller
2011-08-09 9:13 ` [PATCH 12/40] wl12xx: wl12xx-fw-3 - rx/tx changes Eliad Peller
2011-08-09 9:13 ` [PATCH 13/40] wl12xx: wl12xx-fw-3 - change max/default template size Eliad Peller
2011-08-09 9:13 ` [PATCH 14/40] wl12xx: use wl1271_acx_beacon_filter_opt for both sta and ap Eliad Peller
2011-08-09 9:13 ` [PATCH 15/40] wl12xx: add set_rate_mgmt_params acx Eliad Peller
2011-08-10 12:31 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 16/40] wl12xx: add system_hlid Eliad Peller
2011-08-10 12:48 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 17/40] wl12xx: add ROC/CROC commands Eliad Peller
2011-08-10 12:57 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 18/40] wl12xx: replace dummy_join with " Eliad Peller
2011-08-10 14:31 ` Luciano Coelho [this message]
2011-08-11 11:03 ` Eliad Peller
2011-08-09 9:13 ` [PATCH 19/40] wl12xx: handle dummy packet event also in ap mode Eliad Peller
2011-08-09 9:13 ` [PATCH 20/40] wl12xx: update BT coex configuration params Eliad Peller
2011-08-10 15:16 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 21/40] wl12xx: fix session counter Eliad Peller
2011-08-10 15:20 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 22/40] wl12xx: use dynamic hlids for AP-mode Eliad Peller
2011-08-10 19:39 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 23/40] wl12xx: re-enable block ack session support Eliad Peller
2011-08-10 19:54 ` Luciano Coelho
2011-08-15 9:34 ` Levi, Shahar
2011-08-09 9:13 ` [PATCH 24/40] wl12xx: call wl1271_cmd_set_peer_state() in AP mode Eliad Peller
2011-08-09 9:13 ` [PATCH 25/40] wl12xx: don't remove key if hlid was already deleted Eliad Peller
2011-08-09 9:13 ` [PATCH 26/40] wl12xx: add wl1271_cmd_role_start_ibss() Eliad Peller
2011-08-11 7:15 ` Luciano Coelho
2011-08-09 9:13 ` [PATCH 27/40] wl12xx: support IBSS vif type Eliad Peller
2011-08-09 9:13 ` [PATCH 28/40] wl12xx: AP-mode - set STA HT capabilities when adding a STA Eliad Peller
2011-08-09 9:13 ` [PATCH 29/40] wl12xx: AP-mode - configure STA HT rates on join Eliad Peller
2011-08-09 9:13 ` [PATCH 30/40] wl12xx: AP-mode - configure HT rate support to the FW Eliad Peller
2011-08-10 20:30 ` Luciano Coelho
2011-08-11 4:39 ` Arik Nemtsov
2011-08-09 9:13 ` [PATCH 31/40] wl12xx: use ap_bcast_hlid for recorded keys Eliad Peller
2011-08-09 9:13 ` [PATCH 32/40] wl12xx: don't remove key if hlid was already deleted Eliad Peller
2011-08-09 9:13 ` [PATCH 33/40] wl12xx: track freed packets in FW by AC Eliad Peller
2011-08-11 9:17 ` Luciano Coelho
2011-08-11 9:41 ` Eliad Peller
2011-08-11 16:11 ` Arik Nemtsov
2011-08-09 9:13 ` [PATCH 34/40] wl12xx: schedule TX packets according to FW packet occupancy Eliad Peller
2011-08-11 11:38 ` Luciano Coelho
2011-08-11 20:54 ` Arik Nemtsov
2011-08-09 9:13 ` [PATCH 35/40] wl12xx: handle wrap-around overflow in released Tx blocks FW counter Eliad Peller
2011-08-09 9:13 ` [PATCH 36/40] wl12xx: enable AP advanced functionality Eliad Peller
2011-08-09 9:13 ` [PATCH 37/40] wl12xx: don't wait for disconnection event Eliad Peller
2011-08-11 11:53 ` Luciano Coelho
2011-08-11 12:30 ` Eliad Peller
2011-08-09 9:13 ` [PATCH 38/40] wl12xx: set the AP-started flag only after setting keys Eliad Peller
2011-08-09 9:13 ` [PATCH 39/40] wl12xx: AP-mode - prevent Tx to stale/invalid stations Eliad Peller
2011-08-09 9:13 ` [PATCH 40/40] wl12xx: fix tx_queue_count spurious increment Eliad Peller
2011-08-11 11:57 ` [PATCH 00/40] wl12xx: move to wl12xx-fw-3 Luciano Coelho
2011-08-11 12:31 ` Eliad Peller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1312986698.2407.668.camel@cumari \
--to=coelho@ti.com \
--cc=eliad@wizery.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox