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

Commit 0dc5a290 authored by Dan Williams's avatar Dan Williams Committed by John W. Linville
Browse files

[PATCH] libertas: remove WLAN_802_11_NETWORK_INFRASTRUCTURE enum



Use standard IW_MODE_* constants instead.

Signed-off-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 889c05bd
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -23,13 +23,13 @@ static int assoc_helper_essid(wlan_private *priv,
	ENTER();

	lbs_pr_debug(1, "New SSID requested: %s\n", assoc_req->ssid.ssid);
	if (assoc_req->mode == wlan802_11infrastructure) {
	if (assoc_req->mode == IW_MODE_INFRA) {
		if (adapter->prescan) {
			libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 1);
		}

		i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid,
				NULL, wlan802_11infrastructure);
				NULL, IW_MODE_INFRA);
		if (i >= 0) {
			lbs_pr_debug(1,
			       "SSID found in scan list ... associating...\n");
@@ -44,7 +44,7 @@ static int assoc_helper_essid(wlan_private *priv,
			lbs_pr_debug(1, "SSID '%s' not found; cannot associate\n",
				assoc_req->ssid.ssid);
		}
	} else if (assoc_req->mode == wlan802_11ibss) {
	} else if (assoc_req->mode == IW_MODE_ADHOC) {
		/* Scan for the network, do not save previous results.  Stale
		 *   scan data will cause us to join a non-existant adhoc network
		 */
@@ -52,7 +52,7 @@ static int assoc_helper_essid(wlan_private *priv,

		/* Search for the requested SSID in the scan table */
		i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL,
				wlan802_11ibss);
				IW_MODE_ADHOC);
		if (i >= 0) {
			lbs_pr_debug(1, "SSID found at %d in List, so join\n", ret);
			libertas_join_adhoc_network(priv, &adapter->scantable[i]);
@@ -90,10 +90,10 @@ static int assoc_helper_bssid(wlan_private *priv,
		goto out;
	}

	if (assoc_req->mode == wlan802_11infrastructure) {
	if (assoc_req->mode == IW_MODE_INFRA) {
		ret = wlan_associate(priv, &adapter->scantable[i]);
		lbs_pr_debug(1, "ASSOC: return from wlan_associate(bssd) was %d\n", ret);
	} else if (assoc_req->mode == wlan802_11ibss) {
	} else if (assoc_req->mode == IW_MODE_ADHOC) {
		libertas_join_adhoc_network(priv, &adapter->scantable[i]);
	}
	memcpy(&assoc_req->ssid, &adapter->scantable[i].ssid,
@@ -142,23 +142,23 @@ static int assoc_helper_mode(wlan_private *priv,

	ENTER();

	if (assoc_req->mode == adapter->inframode) {
	if (assoc_req->mode == adapter->mode) {
		LEAVE();
		return 0;
	}

	if (assoc_req->mode == wlan802_11infrastructure) {
	if (assoc_req->mode == IW_MODE_INFRA) {
		if (adapter->psstate != PS_STATE_FULL_POWER)
			libertas_ps_wakeup(priv, cmd_option_waitforrsp);
		adapter->psmode = wlan802_11powermodecam;
	}

	adapter->inframode = assoc_req->mode;
	adapter->mode = assoc_req->mode;
	ret = libertas_prepare_and_send_command(priv,
				    cmd_802_11_snmp_mib,
				    0, cmd_option_waitforrsp,
				    OID_802_11_INFRASTRUCTURE_MODE,
				    (void *) assoc_req->mode);
				    (void *) (size_t) assoc_req->mode);

	LEAVE();
	return ret;
@@ -315,7 +315,7 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,

	/* FIXME: deal with 'auto' mode somehow */
	if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
		if (assoc_req->mode != wlan802_11infrastructure)
		if (assoc_req->mode != IW_MODE_INFRA)
			return 1;
	}

@@ -337,7 +337,7 @@ static int should_stop_adhoc(wlan_adapter *adapter,

	/* FIXME: deal with 'auto' mode somehow */
	if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
		if (assoc_req->mode != wlan802_11ibss)
		if (assoc_req->mode != IW_MODE_ADHOC)
			return 1;
	}

@@ -381,7 +381,7 @@ void wlan_association_worker(struct work_struct *work)
	}

	if (find_any_ssid) {
		enum WLAN_802_11_NETWORK_INFRASTRUCTURE new_mode;
		u8 new_mode;

		ret = libertas_find_best_network_SSID(priv, &assoc_req->ssid,
				assoc_req->mode, &new_mode);
@@ -392,7 +392,7 @@ void wlan_association_worker(struct work_struct *work)
		}

		/* Ensure we switch to the mode of the AP */
		if (assoc_req->mode == wlan802_11autounknown) {
		if (assoc_req->mode == IW_MODE_AUTO) {
			set_bit(ASSOC_FLAG_MODE, &assoc_req->flags);
			assoc_req->mode = new_mode;
		}
@@ -402,7 +402,7 @@ void wlan_association_worker(struct work_struct *work)
	 * Check if the attributes being changing require deauthentication
	 * from the currently associated infrastructure access point.
	 */
	if (adapter->inframode == wlan802_11infrastructure) {
	if (adapter->mode == IW_MODE_INFRA) {
		if (should_deauth_infrastructure(adapter, assoc_req)) {
			ret = libertas_send_deauthentication(priv);
			if (ret) {
@@ -411,7 +411,7 @@ void wlan_association_worker(struct work_struct *work)
					ret);
			}
		}
	} else if (adapter->inframode == wlan802_11ibss) {
	} else if (adapter->mode == IW_MODE_ADHOC) {
		if (should_stop_adhoc(adapter, assoc_req)) {
			ret = libertas_stop_adhoc_network(priv);
			if (ret) {
@@ -542,7 +542,7 @@ struct assoc_request * wlan_get_association_request(wlan_adapter *adapter)
		assoc_req->channel = adapter->curbssparams.channel;

	if (!test_bit(ASSOC_FLAG_MODE, &assoc_req->flags))
		assoc_req->mode = adapter->inframode;
		assoc_req->mode = adapter->mode;

	if (!test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) {
		memcpy(&assoc_req->bssid, adapter->curbssparams.bssid,
+6 −5
Original line number Diff line number Diff line
@@ -381,15 +381,16 @@ static int wlan_cmd_802_11_snmp_mib(wlan_private * priv,
	switch (cmd_oid) {
	case OID_802_11_INFRASTRUCTURE_MODE:
	{
		enum WLAN_802_11_NETWORK_INFRASTRUCTURE mode =
			(enum WLAN_802_11_NETWORK_INFRASTRUCTURE) pdata_buf;
		u8 mode = (u8) (size_t) pdata_buf;
		pSNMPMIB->querytype = cpu_to_le16(cmd_act_set);
		pSNMPMIB->oid = cpu_to_le16((u16) desired_bsstype_i);
		pSNMPMIB->bufsize = sizeof(u8);
		if (mode == wlan802_11infrastructure)
			ucTemp = SNMP_MIB_VALUE_INFRA;
		else
		if (mode == IW_MODE_ADHOC) {
			ucTemp = SNMP_MIB_VALUE_ADHOC;
		} else {
			/* Infra and Auto modes */
			ucTemp = SNMP_MIB_VALUE_INFRA;
		}

		memmove(pSNMPMIB->value, &ucTemp, sizeof(u8));

+1 −1
Original line number Diff line number Diff line
@@ -809,7 +809,7 @@ int libertas_process_rx_command(wlan_private * priv)
		if (result) {
			lbs_pr_debug(1, "CMD_RESP: PS command failed- %#x \n",
			       resp->result);
			if (adapter->inframode == wlan802_11ibss) {
			if (adapter->mode == IW_MODE_ADHOC) {
				/*
				 * We should not re-try enter-ps command in
				 * ad-hoc mode. It takes place in
+0 −9
Original line number Diff line number Diff line
@@ -267,15 +267,6 @@ enum mv_ms_type {
	MVMS_EVENT
};

/** WLAN_802_11_NETWORK_INFRASTRUCTURE */
enum WLAN_802_11_NETWORK_INFRASTRUCTURE {
	wlan802_11ibss,
	wlan802_11infrastructure,
	wlan802_11autounknown,
	/*defined as upper bound */
	wlan802_11infrastructuremax
};

/** SNMP_MIB_INDEX_e */
enum SNMP_MIB_INDEX_e {
	desired_bsstype_i = 0,
+3 −2
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ struct assoc_request {

	struct WLAN_802_11_SSID ssid;
	u8 channel;
	enum WLAN_802_11_NETWORK_INFRASTRUCTURE mode;
	u8 mode;
	u8 bssid[ETH_ALEN];

	/** WEP keys */
@@ -252,7 +252,8 @@ struct _wlan_adapter {
	/** current ssid/bssid related parameters*/
	struct current_bss_params curbssparams;

	enum WLAN_802_11_NETWORK_INFRASTRUCTURE inframode;
	/* IW_MODE_* */
	u8 mode;

	struct bss_descriptor *pattemptedbssdesc;

Loading