static u8 wlan_channel = INVALID_CHANNEL;
static u8 curr_channel;
static u8 p2p_oui[] = {0x50, 0x6f, 0x9A, 0x09};
-static u8 p2p_local_random = 0x01;
-static u8 p2p_recv_random;
static u8 p2p_vendor_spec[] = {0xdd, 0x05, 0x00, 0x08, 0x40, 0x03};
-static bool wilc_ie;
static struct ieee80211_supported_band wilc_band_2ghz = {
.channels = ieee80211_2ghz_channels,
GFP_KERNEL);
} else if (conn_disconn_evt == CONN_DISCONN_EVENT_DISCONN_NOTIF) {
vif->obtaining_ip = false;
- p2p_local_random = 0x01;
- p2p_recv_random = 0x00;
- wilc_ie = false;
+ priv->p2p.local_random = 0x01;
+ priv->p2p.recv_random = 0x00;
+ priv->p2p.is_wilc_ie = false;
eth_zero_addr(priv->associated_bss);
wilc_wlan_set_bssid(priv->dev, null_bssid, STATION_MODE);
wlan_channel = INVALID_CHANNEL;
wilc_wlan_set_bssid(priv->dev, null_bssid, STATION_MODE);
- p2p_local_random = 0x01;
- p2p_recv_random = 0x00;
- wilc_ie = false;
+ priv->p2p.local_random = 0x01;
+ priv->p2p.recv_random = 0x00;
+ priv->p2p.is_wilc_ie = false;
wfi_drv->p2p_timeout = 0;
ret = wilc_disconnect(vif, reason_code);
struct wilc_vif *vif = netdev_priv(priv->dev);
subtype = buff[P2P_PUB_ACTION_SUBTYPE];
- if ((subtype == GO_NEG_REQ || subtype == GO_NEG_RSP) && !wilc_ie) {
+ if ((subtype == GO_NEG_REQ || subtype == GO_NEG_RSP) &&
+ !priv->p2p.is_wilc_ie) {
for (i = P2P_PUB_ACTION_SUBTYPE; i < size; i++) {
if (!memcmp(p2p_vendor_spec, &buff[i], 6)) {
- p2p_recv_random = buff[i + 6];
- wilc_ie = true;
+ priv->p2p.recv_random = buff[i + 6];
+ priv->p2p.is_wilc_ie = true;
break;
}
}
}
- if (p2p_local_random <= p2p_recv_random) {
+ if (priv->p2p.local_random <= priv->p2p.recv_random) {
netdev_dbg(vif->ndev,
"PEER WILL BE GO LocaRand=%02x RecvRand %02x\n",
- p2p_local_random, p2p_recv_random);
+ priv->p2p.local_random, priv->p2p.recv_random);
return;
}
size);
if ((subtype == GO_NEG_REQ || subtype == GO_NEG_RSP) &&
- wilc_ie)
+ priv->p2p.is_wilc_ie)
size -= 7;
break;
priv->remain_on_ch_params.listen_session_id);
}
-static void wilc_wfi_cfg_tx_vendor_spec(struct p2p_mgmt_data *mgmt_tx,
+static void wilc_wfi_cfg_tx_vendor_spec(struct wilc_priv *priv,
+ struct p2p_mgmt_data *mgmt_tx,
struct cfg80211_mgmt_tx_params *params,
u8 iftype, u32 buf_len)
{
u8 subtype = buf[P2P_PUB_ACTION_SUBTYPE];
if (subtype == GO_NEG_REQ || subtype == GO_NEG_RSP) {
- if (p2p_local_random == 1 &&
- p2p_recv_random < p2p_local_random) {
- get_random_bytes(&p2p_local_random, 1);
- p2p_local_random++;
+ if (priv->p2p.local_random == 1 &&
+ priv->p2p.recv_random < priv->p2p.local_random) {
+ get_random_bytes(&priv->p2p.local_random, 1);
+ priv->p2p.local_random++;
}
}
- if (p2p_local_random <= p2p_recv_random || !(subtype == GO_NEG_REQ ||
- subtype == GO_NEG_RSP ||
- subtype == P2P_INV_REQ ||
- subtype == P2P_INV_RSP))
+ if (priv->p2p.local_random <= priv->p2p.recv_random ||
+ !(subtype == GO_NEG_REQ || subtype == GO_NEG_RSP ||
+ subtype == P2P_INV_REQ || subtype == P2P_INV_RSP))
return;
for (i = P2P_PUB_ACTION_SUBTYPE + 2; i < len; i++) {
memcpy(&mgmt_tx->buff[len], p2p_vendor_spec,
vendor_spec_len);
- mgmt_tx->buff[len + vendor_spec_len] = p2p_local_random;
+ mgmt_tx->buff[len + vendor_spec_len] = priv->p2p.local_random;
mgmt_tx->size = buf_len;
}
}
struct wilc_priv *priv = wiphy_priv(wiphy);
struct host_if_drv *wfi_drv = priv->hif_drv;
struct wilc_vif *vif = netdev_priv(wdev->netdev);
- u32 buf_len = len + sizeof(p2p_vendor_spec) + sizeof(p2p_local_random);
+ u32 buf_len = len + sizeof(p2p_vendor_spec) + sizeof(priv->p2p.local_random);
int ret = 0;
*cookie = (unsigned long)buf;
case PUBLIC_ACT_VENDORSPEC:
if (!memcmp(p2p_oui, &buf[ACTION_SUBTYPE_ID + 1], 4))
- wilc_wfi_cfg_tx_vendor_spec(mgmt_tx, params,
- vif->iftype,
+ wilc_wfi_cfg_tx_vendor_spec(priv, mgmt_tx,
+ params, vif->iftype,
buf_len);
else
netdev_dbg(vif->ndev,
struct wilc_vif *vif = netdev_priv(dev);
struct wilc *wl = vif->wilc;
- p2p_local_random = 0x01;
- p2p_recv_random = 0x00;
- wilc_ie = false;
+ priv->p2p.local_random = 0x01;
+ priv->p2p.recv_random = 0x00;
+ priv->p2p.is_wilc_ie = false;
vif->obtaining_ip = false;
del_timer(&vif->during_ip_timer);