Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e0645c3 authored by nohee ko's avatar nohee ko Committed by Greg Kroah-Hartman
Browse files

staging: brcm80211: brcmfmac: add profile, beacon_int, dtim_period



Add profile, beacon_int & dtim_period.
This profile can be seen through debugfs.

Signed-off-by: default avatarNohee Ko <noheek@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c5ca038f
Loading
Loading
Loading
Loading
+39 −1
Original line number Diff line number Diff line
@@ -2553,6 +2553,11 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
	struct cfg80211_bss *bss;
	struct wl_bss_info *bi;
	struct wlc_ssid *ssid;
	struct bcm_tlv *tim;
	u16 beacon_interval;
	u8 dtim_period;
	size_t ie_len;
	u8 *ie;
	s32 err = 0;

	if (wl_is_ibssmode(wl))
@@ -2582,11 +2587,38 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
		err = wl_inform_single_bss(wl, bi);
		if (unlikely(err))
			goto update_bss_info_out;

		ie = ((u8 *)bi) + bi->ie_offset;
		ie_len = bi->ie_length;
		beacon_interval = cpu_to_le16(bi->beacon_period);
	} else {
		WL_DBG(("Found the AP in the list - BSSID %pM\n", bss->bssid));
		ie = bss->information_elements;
		ie_len = bss->len_information_elements;
		beacon_interval = bss->beacon_interval;
		cfg80211_put_bss(bss);
	}

	tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM);
	if (tim) {
		dtim_period = tim->data[1];
	} else {
		/*
		* active scan was done so we could not get dtim
		* information out of probe response.
		* so we speficially query dtim information to dongle.
		*/
		err = wl_dev_ioctl(wl_to_ndev(wl), WLC_GET_DTIMPRD,
			&dtim_period, sizeof(dtim_period));
		if (unlikely(err)) {
			WL_ERR(("WLC_GET_DTIMPRD error (%d)\n", err));
			goto update_bss_info_out;
		}
	}

	wl_update_prof(wl, NULL, &beacon_interval, WL_PROF_BEACONINT);
	wl_update_prof(wl, NULL, &dtim_period, WL_PROF_DTIMPERIOD);

update_bss_info_out:
	rtnl_unlock();
	return err;
@@ -3902,6 +3934,12 @@ wl_update_prof(struct wl_priv *wl, const wl_event_msg_t *e, void *data,
	case WL_PROF_ACT:
		wl->profile->active = *(bool *)data;
		break;
	case WL_PROF_BEACONINT:
		wl->profile->beacon_interval = *(u16 *)data;
		break;
	case WL_PROF_DTIMPERIOD:
		wl->profile->dtim_period = *(u8 *)data;
		break;
	default:
		WL_ERR(("unsupported item (%d)\n", item));
		err = -EOPNOTSUPP;
+5 −1
Original line number Diff line number Diff line
@@ -136,7 +136,9 @@ enum wl_prof_list {
	WL_PROF_IBSS,
	WL_PROF_BAND,
	WL_PROF_BSSID,
	WL_PROF_ACT
	WL_PROF_ACT,
	WL_PROF_BEACONINT,
	WL_PROF_DTIMPERIOD
};

/* dongle iscan state */
@@ -237,6 +239,8 @@ struct wl_profile {
	u32 mode;
	struct wlc_ssid ssid;
	u8 bssid[ETHER_ADDR_LEN];
	u16 beacon_interval;
	u8 dtim_period;
	struct wl_security sec;
	struct wl_ibss ibss;
	s32 band;