Commit 58af40a9 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman
Browse files

staging: rtl8723au: Delete unused rtw_cfg80211_set_mgnt_wpsp2pie()

parent cc2db7cb
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -88,9 +88,6 @@ void rtw_cfg80211_issue_p2p_provision_request23a(struct rtw_adapter *padapter,
void rtw_cfg80211_rx_action(struct rtw_adapter *adapter, u8 *frame,
			    uint frame_len, const char*msg);

int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len,
				   int type);

bool rtw_cfg80211_pwr_mgmt(struct rtw_adapter *adapter);

#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp)	\
+0 −166
Original line number Diff line number Diff line
@@ -3189,172 +3189,6 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
	return;
}

static int rtw_cfg80211_set_beacon_wpsp2pie(struct net_device *ndev, char *buf,
					    int len)
{
	int ret = 0;
	uint wps_ielen = 0;
	u8 *wps_ie;
#ifdef CONFIG_8723AU_AP_MODE
	u8 wps_oui[8] = { 0x0, 0x50, 0xf2, 0x04 };
#endif
	struct rtw_adapter *padapter = netdev_priv(ndev);
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;

	DBG_8723A("%s(%s): ielen =%d\n", __func__, ndev->name, len);

	if (len > 0) {
		wps_ie = rtw_get_wps_ie23a(buf, len, NULL, &wps_ielen);
		if (wps_ie) {
			DBG_8723A("bcn_wps_ielen =%d\n", wps_ielen);

			if (pmlmepriv->wps_beacon_ie) {
				pmlmepriv->wps_beacon_ie_len = 0;
				kfree(pmlmepriv->wps_beacon_ie);
				pmlmepriv->wps_beacon_ie = NULL;
			}

			pmlmepriv->wps_beacon_ie = kmemdup(wps_ie, wps_ielen,
							   GFP_KERNEL);
			if (pmlmepriv->wps_beacon_ie == NULL) {
				DBG_8723A("%s()-%d: kmalloc() ERROR!\n",
					  __func__, __LINE__);
				return -EINVAL;
			}
			pmlmepriv->wps_beacon_ie_len = wps_ielen;

#ifdef CONFIG_8723AU_AP_MODE
			update_beacon23a(padapter, WLAN_EID_VENDOR_SPECIFIC,
					 wps_oui, true);
#endif
		}

		pmlmeext->bstart_bss = true;

	}

	return ret;
}

static int rtw_cfg80211_set_probe_resp_wpsp2pie(struct net_device *net,
						char *buf, int len)
{
	struct rtw_adapter *padapter = netdev_priv(net);
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
	int ret = 0;
	uint wps_ielen = 0;
	u8 *wps_ie;

	if (len > 0) {
		wps_ie = rtw_get_wps_ie23a(buf, len, NULL, &wps_ielen);
		if (wps_ie) {
			uint attr_contentlen = 0;
			u16 uconfig_method, *puconfig_method = NULL;

			if (pmlmepriv->wps_probe_resp_ie) {
				pmlmepriv->wps_probe_resp_ie_len = 0;
				kfree(pmlmepriv->wps_probe_resp_ie);
				pmlmepriv->wps_probe_resp_ie = NULL;
			}

			pmlmepriv->wps_probe_resp_ie =
				kmalloc(wps_ielen, GFP_KERNEL);
			if (pmlmepriv->wps_probe_resp_ie == NULL) {
				DBG_8723A("%s()-%d: kmalloc() ERROR!\n",
					  __func__, __LINE__);
				return -EINVAL;

			}

			/* add PUSH_BUTTON config_method by driver self in
			   wpsie of probe_resp at GO Mode */
			puconfig_method = (u16 *)rtw_get_wps_attr_content23a(wps_ie, wps_ielen,
							      WPS_ATTR_CONF_METHOD,
							      NULL,
							      &attr_contentlen);
			if (puconfig_method) {
				uconfig_method = WPS_CM_PUSH_BUTTON;
				uconfig_method = cpu_to_be16(uconfig_method);

				*puconfig_method |= uconfig_method;
			}

			memcpy(pmlmepriv->wps_probe_resp_ie, wps_ie, wps_ielen);
			pmlmepriv->wps_probe_resp_ie_len = wps_ielen;

		}

	}

	return ret;
}

static int rtw_cfg80211_set_assoc_resp_wpsp2pie(struct net_device *net,
						char *buf, int len)
{
	int ret = 0;
	struct rtw_adapter *padapter = netdev_priv(net);
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

	DBG_8723A("%s, ielen =%d\n", __func__, len);

	if (len > 0) {
		if (pmlmepriv->wps_assoc_resp_ie) {
			pmlmepriv->wps_assoc_resp_ie_len = 0;
			kfree(pmlmepriv->wps_assoc_resp_ie);
			pmlmepriv->wps_assoc_resp_ie = NULL;
		}

		pmlmepriv->wps_assoc_resp_ie = kmemdup(buf, len, GFP_KERNEL);
		if (pmlmepriv->wps_assoc_resp_ie == NULL) {
			DBG_8723A("%s()-%d: kmalloc() ERROR!\n",
				  __func__, __LINE__);
			return -EINVAL;

		}
		pmlmepriv->wps_assoc_resp_ie_len = len;
	}

	return ret;
}

int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len,
				   int type)
{
	int ret = 0;
	uint wps_ielen = 0;

	DBG_8723A("%s, ielen =%d\n", __func__, len);

	if (rtw_get_wps_ie23a(buf, len, NULL, &wps_ielen) && (wps_ielen > 0)) {
		if (net) {
			switch (type) {
			case 0x1:	/* BEACON */
				ret =
				    rtw_cfg80211_set_beacon_wpsp2pie(net, buf,
								     len);
				break;
			case 0x2:	/* PROBE_RESP */
				ret =
				    rtw_cfg80211_set_probe_resp_wpsp2pie(net,
									 buf,
									 len);
				break;
			case 0x4:	/* ASSOC_RESP */
				ret =
				    rtw_cfg80211_set_assoc_resp_wpsp2pie(net,
									 buf,
									 len);
				break;
			}
		}
	}

	return ret;

}

static struct cfg80211_ops rtw_cfg80211_ops = {
	.change_virtual_intf = cfg80211_rtw_change_iface,
	.add_key = cfg80211_rtw_add_key,