diff options
author | Stanislav Yakovlev <stas.yakovlev@gmail.com> | 2012-11-20 18:54:20 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-11-21 14:16:02 -0500 |
commit | 067293876ef9be3f29492d4b80c267bbd6369b92 (patch) | |
tree | 49a69de7224459b959a356902ad7d9111bf6e880 /drivers/net/wireless/ipw2x00 | |
parent | 2884561a6472d6f9c960ccf2250a72ca058167a1 (diff) |
net/wireless: ipw2200: introduce ipw_set_geo function
Move regulatory domain initialization code to a separate function.
Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ipw2x00')
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2200.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index fea96b58ab89..482f505f3f35 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -11269,10 +11269,31 @@ static const struct libipw_geo ipw_geos[] = { | |||
11269 | } | 11269 | } |
11270 | }; | 11270 | }; |
11271 | 11271 | ||
11272 | static void ipw_set_geo(struct ipw_priv *priv) | ||
11273 | { | ||
11274 | int j; | ||
11275 | |||
11276 | for (j = 0; j < ARRAY_SIZE(ipw_geos); j++) { | ||
11277 | if (!memcmp(&priv->eeprom[EEPROM_COUNTRY_CODE], | ||
11278 | ipw_geos[j].name, 3)) | ||
11279 | break; | ||
11280 | } | ||
11281 | |||
11282 | if (j == ARRAY_SIZE(ipw_geos)) { | ||
11283 | IPW_WARNING("SKU [%c%c%c] not recognized.\n", | ||
11284 | priv->eeprom[EEPROM_COUNTRY_CODE + 0], | ||
11285 | priv->eeprom[EEPROM_COUNTRY_CODE + 1], | ||
11286 | priv->eeprom[EEPROM_COUNTRY_CODE + 2]); | ||
11287 | j = 0; | ||
11288 | } | ||
11289 | |||
11290 | libipw_set_geo(priv->ieee, &ipw_geos[j]); | ||
11291 | } | ||
11292 | |||
11272 | #define MAX_HW_RESTARTS 5 | 11293 | #define MAX_HW_RESTARTS 5 |
11273 | static int ipw_up(struct ipw_priv *priv) | 11294 | static int ipw_up(struct ipw_priv *priv) |
11274 | { | 11295 | { |
11275 | int rc, i, j; | 11296 | int rc, i; |
11276 | 11297 | ||
11277 | /* Age scan list entries found before suspend */ | 11298 | /* Age scan list entries found before suspend */ |
11278 | if (priv->suspend_time) { | 11299 | if (priv->suspend_time) { |
@@ -11310,19 +11331,7 @@ static int ipw_up(struct ipw_priv *priv) | |||
11310 | memcpy(priv->net_dev->dev_addr, priv->mac_addr, ETH_ALEN); | 11331 | memcpy(priv->net_dev->dev_addr, priv->mac_addr, ETH_ALEN); |
11311 | memcpy(priv->net_dev->perm_addr, priv->mac_addr, ETH_ALEN); | 11332 | memcpy(priv->net_dev->perm_addr, priv->mac_addr, ETH_ALEN); |
11312 | 11333 | ||
11313 | for (j = 0; j < ARRAY_SIZE(ipw_geos); j++) { | 11334 | ipw_set_geo(priv); |
11314 | if (!memcmp(&priv->eeprom[EEPROM_COUNTRY_CODE], | ||
11315 | ipw_geos[j].name, 3)) | ||
11316 | break; | ||
11317 | } | ||
11318 | if (j == ARRAY_SIZE(ipw_geos)) { | ||
11319 | IPW_WARNING("SKU [%c%c%c] not recognized.\n", | ||
11320 | priv->eeprom[EEPROM_COUNTRY_CODE + 0], | ||
11321 | priv->eeprom[EEPROM_COUNTRY_CODE + 1], | ||
11322 | priv->eeprom[EEPROM_COUNTRY_CODE + 2]); | ||
11323 | j = 0; | ||
11324 | } | ||
11325 | libipw_set_geo(priv->ieee, &ipw_geos[j]); | ||
11326 | 11335 | ||
11327 | if (priv->status & STATUS_RF_KILL_SW) { | 11336 | if (priv->status & STATUS_RF_KILL_SW) { |
11328 | IPW_WARNING("Radio disabled by module parameter.\n"); | 11337 | IPW_WARNING("Radio disabled by module parameter.\n"); |