old mode 100644new mode 100755.. | .. |
---|
508 | 508 | int wldev_set_country( |
---|
509 | 509 | struct net_device *dev, char *country_code, bool notify, int revinfo) |
---|
510 | 510 | { |
---|
511 | | - int error = 0; |
---|
512 | 511 | #if defined(BCMDONGLEHOST) |
---|
513 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
| 512 | + int error = -1; |
---|
| 513 | + wl_country_t cspec = {{0}, 0, {0}}; |
---|
514 | 514 | |
---|
515 | 515 | if (!country_code) |
---|
516 | | - return -1; |
---|
517 | | - error = dhd_conf_country(dhd, "country", country_code); |
---|
518 | | - dhd_bus_country_set(dev, &dhd->dhd_cspec, notify); |
---|
| 516 | + return error; |
---|
| 517 | + |
---|
| 518 | + cspec.rev = revinfo; |
---|
| 519 | + strlcpy(cspec.country_abbrev, country_code, WL_CCODE_LEN + 1); |
---|
| 520 | + strlcpy(cspec.ccode, country_code, WL_CCODE_LEN + 1); |
---|
| 521 | + error = dhd_conf_map_country_list(dhd_get_pub(dev), &cspec); |
---|
| 522 | + if (error) |
---|
| 523 | + dhd_get_customized_country_code(dev, (char *)&cspec.country_abbrev, &cspec); |
---|
| 524 | + error = dhd_conf_set_country(dhd_get_pub(dev), &cspec); |
---|
| 525 | + if (error < 0) { |
---|
| 526 | + WLDEV_ERROR(("%s: set country for %s as %s rev %d failed\n", |
---|
| 527 | + __FUNCTION__, country_code, cspec.ccode, cspec.rev)); |
---|
| 528 | + return error; |
---|
| 529 | + } |
---|
| 530 | + dhd_conf_fix_country(dhd_get_pub(dev)); |
---|
| 531 | + dhd_conf_get_country(dhd_get_pub(dev), &cspec); |
---|
| 532 | + dhd_bus_country_set(dev, &cspec, notify); |
---|
519 | 533 | printf("%s: set country for %s as %s rev %d\n", |
---|
520 | | - __FUNCTION__, country_code, dhd->dhd_cspec.ccode, dhd->dhd_cspec.rev); |
---|
| 534 | + __FUNCTION__, country_code, cspec.ccode, cspec.rev); |
---|
521 | 535 | #endif /* defined(BCMDONGLEHOST) */ |
---|
522 | | - return error; |
---|
| 536 | + return 0; |
---|
523 | 537 | } |
---|