| 5701 | } |
| 5702 | |
| 5703 | static void |
| 5704 | setdefregdomain(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, ®domain); |
| 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. |
no test coverage detected