A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/torvalds/linux/commit/effd05ac479b80641835f9126bbe93146686c2b8 below:

support random MAC address for scanning · torvalds/linux@effd05a · GitHub

File tree 2 files changed

+34

-7

lines changed

Filter options

2 files changed

+34

-7

lines changed Original file line number Diff line number Diff line change

@@ -344,8 +344,12 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)

344 344

}

345 345 346 346

if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_LMAC_SCAN ||

347 -

mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN)

347 +

mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN) {

348 348

hw->flags |= IEEE80211_SINGLE_HW_SCAN_ON_ALL_BANDS;

349 +

hw->wiphy->features |=

350 +

NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR |

351 +

NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR;

352 +

}

349 353 350 354

hw->sta_data_size = sizeof(struct iwl_mvm_sta);

351 355

hw->vif_data_size = sizeof(struct iwl_mvm_vif);

Original file line number Diff line number Diff line change

@@ -1224,14 +1224,25 @@ static u8 *iwl_mvm_copy_and_insert_ds_elem(struct iwl_mvm *mvm, const u8 *ies,

1224 1224

static void

1225 1225

iwl_mvm_build_unified_scan_probe(struct iwl_mvm *mvm, struct ieee80211_vif *vif,

1226 1226

struct ieee80211_scan_ies *ies,

1227 -

struct iwl_scan_probe_req *preq)

1227 +

struct iwl_scan_probe_req *preq,

1228 +

const u8 *mac_addr, const u8 *mac_addr_mask)

1228 1229

{

1229 1230

struct ieee80211_mgmt *frame = (struct ieee80211_mgmt *)preq->buf;

1230 1231

u8 *pos, *newpos;

1231 1232 1233 +

/*

1234 +

* Unfortunately, right now the offload scan doesn't support randomising

1235 +

* within the firmware, so until the firmware API is ready we implement

1236 +

* it in the driver. This means that the scan iterations won't really be

1237 +

* random, only when it's restarted, but at least that helps a bit.

1238 +

*/

1239 +

if (mac_addr)

1240 +

get_random_mask_addr(frame->sa, mac_addr, mac_addr_mask);

1241 +

else

1242 +

memcpy(frame->sa, vif->addr, ETH_ALEN);

1243 + 1232 1244

frame->frame_control = cpu_to_le16(IEEE80211_STYPE_PROBE_REQ);

1233 1245

eth_broadcast_addr(frame->da);

1234 -

memcpy(frame->sa, vif->addr, ETH_ALEN);

1235 1246

eth_broadcast_addr(frame->bssid);

1236 1247

frame->seq_ctrl = 0;

1237 1248

@@ -1375,7 +1386,10 @@ int iwl_mvm_unified_scan_lmac(struct iwl_mvm *mvm,

1375 1386

preq = (void *)(cmd->data + sizeof(struct iwl_scan_channel_cfg_lmac) *

1376 1387

mvm->fw->ucode_capa.n_scan_channels);

1377 1388 1378 -

iwl_mvm_build_unified_scan_probe(mvm, vif, &req->ies, preq);

1389 +

iwl_mvm_build_unified_scan_probe(mvm, vif, &req->ies, preq,

1390 +

req->req.flags & NL80211_SCAN_FLAG_RANDOM_ADDR ?

1391 +

req->req.mac_addr : NULL,

1392 +

req->req.mac_addr_mask);

1379 1393 1380 1394

ret = iwl_mvm_send_cmd(mvm, &hcmd);

1381 1395

if (!ret) {

@@ -1466,7 +1480,10 @@ int iwl_mvm_unified_sched_scan_lmac(struct iwl_mvm *mvm,

1466 1480

preq = (void *)(cmd->data + sizeof(struct iwl_scan_channel_cfg_lmac) *

1467 1481

mvm->fw->ucode_capa.n_scan_channels);

1468 1482 1469 -

iwl_mvm_build_unified_scan_probe(mvm, vif, ies, preq);

1483 +

iwl_mvm_build_unified_scan_probe(mvm, vif, ies, preq,

1484 +

req->flags & NL80211_SCAN_FLAG_RANDOM_ADDR ?

1485 +

req->mac_addr : NULL,

1486 +

req->mac_addr_mask);

1470 1487 1471 1488

ret = iwl_mvm_send_cmd(mvm, &hcmd);

1472 1489

if (!ret) {

@@ -1796,7 +1813,10 @@ int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,

1796 1813

sec_part->schedule[0].iter_count = 1;

1797 1814

sec_part->delay = 0;

1798 1815 1799 -

iwl_mvm_build_unified_scan_probe(mvm, vif, &req->ies, &sec_part->preq);

1816 +

iwl_mvm_build_unified_scan_probe(mvm, vif, &req->ies, &sec_part->preq,

1817 +

req->req.flags & NL80211_SCAN_FLAG_RANDOM_ADDR ?

1818 +

req->req.mac_addr : NULL,

1819 +

req->req.mac_addr_mask);

1800 1820 1801 1821

iwl_mvm_scan_fill_ssids(sec_part->direct_scan, req->req.ssids,

1802 1822

req->req.n_ssids, 0);

@@ -1901,7 +1921,10 @@ int iwl_mvm_sched_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,

1901 1921 1902 1922

sec_part->delay = 0;

1903 1923 1904 -

iwl_mvm_build_unified_scan_probe(mvm, vif, ies, &sec_part->preq);

1924 +

iwl_mvm_build_unified_scan_probe(mvm, vif, ies, &sec_part->preq,

1925 +

req->flags & NL80211_SCAN_FLAG_RANDOM_ADDR ?

1926 +

req->mac_addr : NULL,

1927 +

req->mac_addr_mask);

1905 1928 1906 1929

ret = iwl_mvm_send_cmd(mvm, &hcmd);

1907 1930

if (!ret) {

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3