MCPcopy Create free account
hub / github.com/F-Stack/f-stack / setdefregdomain

Function setdefregdomain

tools/ifconfig/ifieee80211.c:5703–5739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5701}
5702
5703static void
5704setdefregdomain(int s)
5705{
5706 struct regdata *rdp = getregdata();
5707 const struct regdomain *rd;
5708
5709 /* Check if regdomain/country was already set by a previous call. */
5710 /* XXX is it possible? */
5711 if (regdomain.regdomain != 0 ||
5712 regdomain.country != CTRY_DEFAULT)
5713 return;
5714
5715 getregdomain(s);
5716
5717 /* Check if it was already set by the driver. */
5718 if (regdomain.regdomain != 0 ||
5719 regdomain.country != CTRY_DEFAULT)
5720 return;
5721
5722 /* Set FCC/US as default. */
5723 rd = lib80211_regdomain_findbysku(rdp, SKU_FCC);
5724 if (rd == NULL)
5725 errx(1, "FCC regdomain was not found");
5726
5727 regdomain.regdomain = rd->sku;
5728 if (rd->cc != NULL)
5729 defaultcountry(rd);
5730
5731 /* Send changes to net80211. */
5732 setregdomain_cb(s, &regdomain);
5733
5734 /* Cleanup (so it can be overriden by subsequent parameters). */
5735 regdomain.regdomain = 0;
5736 regdomain.country = CTRY_DEFAULT;
5737 regdomain.isocc[0] = 0;
5738 regdomain.isocc[1] = 0;
5739}
5740
5741/*
5742 * Virtual AP cloning support.

Callers 1

wlan_createFunction · 0.85

Calls 4

getregdataFunction · 0.85
getregdomainFunction · 0.85
defaultcountryFunction · 0.85
setregdomain_cbFunction · 0.85

Tested by

no test coverage detected