Commit 7b0360e5 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman
Browse files

staging: wfx: simplify hif_set_bss_params()



The structure hif_req_set_bss_params come from hardware API. It is not
intended to be manipulated in upper layers of the driver.

In add, current code for hif_req_set_bss_params() is too dumb. It should
pack data with hardware representation instead of leaving all work to
the caller.

Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200420160311.57323-9-Jerome.Pouiller@silabs.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2e885b18
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -321,17 +321,15 @@ int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
	return ret;
}

int hif_set_bss_params(struct wfx_vif *wvif,
		       const struct hif_req_set_bss_params *arg)
int hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count)
{
	int ret;
	struct hif_msg *hif;
	struct hif_req_set_bss_params *body = wfx_alloc_hif(sizeof(*body),
							    &hif);
	struct hif_req_set_bss_params *body =
		wfx_alloc_hif(sizeof(*body), &hif);

	memcpy(body, arg, sizeof(*body));
	cpu_to_le16s(&body->aid);
	cpu_to_le32s(&body->operational_rate_set);
	body->aid = cpu_to_le16(aid);
	body->beacon_lost_count = beacon_lost_count;
	wfx_fill_header(hif, wvif->id, HIF_REQ_ID_SET_BSS_PARAMS,
			sizeof(*body));
	ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false);
+1 −2
Original line number Diff line number Diff line
@@ -48,8 +48,7 @@ int hif_stop_scan(struct wfx_vif *wvif);
int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
	     struct ieee80211_channel *channel, const u8 *ssid, int ssidlen);
int hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout);
int hif_set_bss_params(struct wfx_vif *wvif,
		       const struct hif_req_set_bss_params *arg);
int hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count);
int hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg);
int hif_remove_key(struct wfx_dev *wdev, int idx);
int hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
+3 −8
Original line number Diff line number Diff line
@@ -470,16 +470,11 @@ void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
static void wfx_join_finalize(struct wfx_vif *wvif,
			      struct ieee80211_bss_conf *info)
{
	struct hif_req_set_bss_params bss_params = {
		// beacon_loss_count is defined to 7 in net/mac80211/mlme.c.
		// Let's use the same value.
		.beacon_lost_count = 7,
		.aid = info->aid,
	};

	hif_set_association_mode(wvif, info);
	hif_keep_alive_period(wvif, 0);
	hif_set_bss_params(wvif, &bss_params);
	// beacon_loss_count is defined to 7 in net/mac80211/mlme.c. Let's use
	// the same value.
	hif_set_bss_params(wvif, info->aid, 7);
	hif_set_beacon_wakeup_period(wvif, 1, 1);
	wfx_update_pm(wvif);