.. | .. |
---|
617 | 617 | } |
---|
618 | 618 | |
---|
619 | 619 | param.band = chan_info->band; |
---|
620 | | - err = wl_ext_iovar_getbuf(dev, "bw_cap", ¶m, sizeof(param), |
---|
| 620 | + err = wldev_iovar_getbuf(dev, "bw_cap", ¶m, sizeof(param), |
---|
621 | 621 | iovar_buf, WLC_IOCTL_SMLEN, NULL); |
---|
622 | 622 | if (err) { |
---|
623 | 623 | if (err != BCME_UNSUPPORTED) { |
---|
624 | | - AEXT_ERROR(dev->name, "bw_cap failed, %d\n", err); |
---|
| 624 | + AEXT_TRACE(dev->name, "bw_cap failed, %d\n", err); |
---|
625 | 625 | return err; |
---|
626 | 626 | } else { |
---|
627 | 627 | err = wl_ext_iovar_getint(dev, "mimo_bw_cap", &bw_cap); |
---|
.. | .. |
---|
681 | 681 | static int |
---|
682 | 682 | wl_ext_channel(struct net_device *dev, char* command, int total_len) |
---|
683 | 683 | { |
---|
| 684 | + struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
684 | 685 | struct wl_chan_info chan_info; |
---|
685 | | - int ret; |
---|
686 | | - char band[16]=""; |
---|
687 | | - int channel = 0; |
---|
688 | | - channel_info_t ci; |
---|
689 | | - int bytes_written = 0; |
---|
690 | | - chanspec_t fw_chspec; |
---|
| 686 | + char chan[16]=""; |
---|
| 687 | + int ret, bytes_written = 0; |
---|
| 688 | + chanspec_t chanspec; |
---|
| 689 | + u32 fw_chanspec = 0; |
---|
| 690 | + |
---|
| 691 | + /* get: dhd_priv channel |
---|
| 692 | + * set: dhd_priv channel [6|36|2g6|5g36|6g5] |
---|
| 693 | + */ |
---|
691 | 694 | |
---|
692 | 695 | AEXT_TRACE(dev->name, "cmd %s", command); |
---|
693 | 696 | |
---|
694 | | - sscanf(command, "%*s %d %s", &channel, band); |
---|
695 | | - if (strnicmp(band, "band=auto", strlen("band=auto")) == 0) { |
---|
696 | | - chan_info.band = WLC_BAND_AUTO; |
---|
| 697 | + sscanf(command, "%*s %s", chan); |
---|
| 698 | + memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
---|
| 699 | + if (strnicmp(chan, "2g", strlen("2g")) == 0) { |
---|
| 700 | + chan_info.band = WLC_BAND_2G; |
---|
| 701 | + chan_info.chan = (int)simple_strtol(chan+2, NULL, 10); |
---|
| 702 | + } |
---|
| 703 | + else if (strnicmp(chan, "5g", strlen("5g")) == 0) { |
---|
| 704 | + chan_info.band = WLC_BAND_5G; |
---|
| 705 | + chan_info.chan = (int)simple_strtol(chan+2, NULL, 10); |
---|
697 | 706 | } |
---|
698 | 707 | #ifdef WL_6G_BAND |
---|
699 | | - else if (strnicmp(band, "band=6g", strlen("band=6g")) == 0) { |
---|
| 708 | + else if (strnicmp(chan, "6g", strlen("6g")) == 0) { |
---|
700 | 709 | chan_info.band = WLC_BAND_6G; |
---|
| 710 | + chan_info.chan = (int)simple_strtol(chan+2, NULL, 10); |
---|
701 | 711 | } |
---|
702 | 712 | #endif /* WL_6G_BAND */ |
---|
703 | | - else if (strnicmp(band, "band=5g", strlen("band=5g")) == 0) { |
---|
704 | | - chan_info.band = WLC_BAND_5G; |
---|
| 713 | + else if (strlen(chan)) { |
---|
| 714 | + chan_info.chan = (int)simple_strtol(chan, NULL, 10); |
---|
| 715 | + if (chan_info.chan <= CH_MAX_2G_CHANNEL) |
---|
| 716 | + chan_info.band = WLC_BAND_2G; |
---|
| 717 | + else |
---|
| 718 | + chan_info.band = WLC_BAND_5G; |
---|
705 | 719 | } |
---|
706 | | - else if (strnicmp(band, "band=2g", strlen("band=2g")) == 0) { |
---|
707 | | - chan_info.band = WLC_BAND_2G; |
---|
708 | | - } |
---|
709 | | - else if (channel <= CH_MAX_2G_CHANNEL) |
---|
710 | | - chan_info.band = WLC_BAND_2G; |
---|
711 | | - else |
---|
712 | | - chan_info.band = WLC_BAND_5G; |
---|
713 | 720 | |
---|
714 | | - if (channel > 0) { |
---|
715 | | - chan_info.chan = channel; |
---|
716 | | - ret = wl_ext_set_chanspec(dev, &chan_info, &fw_chspec); |
---|
| 721 | + if (chan_info.chan > 0) { |
---|
| 722 | + ret = wl_ext_set_chanspec(dev, &chan_info, &chanspec); |
---|
717 | 723 | } else { |
---|
718 | | - if (!(ret = wl_ext_ioctl(dev, WLC_GET_CHANNEL, &ci, |
---|
719 | | - sizeof(channel_info_t), FALSE))) { |
---|
720 | | - AEXT_TRACE(dev->name, "hw_channel %d\n", ci.hw_channel); |
---|
721 | | - AEXT_TRACE(dev->name, "target_channel %d\n", ci.target_channel); |
---|
722 | | - AEXT_TRACE(dev->name, "scan_channel %d\n", ci.scan_channel); |
---|
723 | | - bytes_written = snprintf(command, sizeof(channel_info_t)+2, |
---|
724 | | - "channel %d", ci.hw_channel); |
---|
725 | | - AEXT_TRACE(dev->name, "command result is %s\n", command); |
---|
| 724 | + ret = wl_ext_iovar_getint(dev, "chanspec", (s32 *)&fw_chanspec); |
---|
| 725 | + if (ret == BCME_OK) { |
---|
| 726 | + chanspec = fw_chanspec; |
---|
| 727 | + chanspec = wl_ext_chspec_driver_to_host(dhd, chanspec); |
---|
| 728 | + chan_info.band = CHSPEC2WLC_BAND(chanspec); |
---|
| 729 | + chan_info.chan = wf_chspec_ctlchan(chanspec); |
---|
| 730 | + if (chan_info.band == WLC_BAND_6G) { |
---|
| 731 | + bytes_written = snprintf(command, total_len, |
---|
| 732 | + "channel 6g%d", chan_info.chan); |
---|
| 733 | + } else { |
---|
| 734 | + bytes_written = snprintf(command, total_len, |
---|
| 735 | + "channel %d", chan_info.chan); |
---|
| 736 | + } |
---|
726 | 737 | ret = bytes_written; |
---|
727 | 738 | } |
---|
728 | 739 | } |
---|
.. | .. |
---|
735 | 746 | { |
---|
736 | 747 | int ret, i; |
---|
737 | 748 | int bytes_written = -1; |
---|
738 | | - u8 valid_chan_list[sizeof(u32)*(WL_NUMCHANNELS + 1)]; |
---|
739 | | - wl_uint32_list_t *list; |
---|
| 749 | + wl_uint32_list_t *list = NULL; |
---|
| 750 | + chanspec_t chspec; |
---|
| 751 | + u32 channel; |
---|
740 | 752 | |
---|
741 | 753 | AEXT_TRACE(dev->name, "cmd %s", command); |
---|
742 | 754 | |
---|
743 | | - memset(valid_chan_list, 0, sizeof(valid_chan_list)); |
---|
744 | | - list = (wl_uint32_list_t *)(void *) valid_chan_list; |
---|
745 | | - list->count = htod32(WL_NUMCHANNELS); |
---|
746 | | - ret = wl_ext_ioctl(dev, WLC_GET_VALID_CHANNELS, valid_chan_list, |
---|
747 | | - sizeof(valid_chan_list), 0); |
---|
748 | | - if (ret<0) { |
---|
| 755 | + list = kzalloc(sizeof(u32)*(MAX_CTRL_CHANSPECS + 1), GFP_KERNEL); |
---|
| 756 | + if (list == NULL) { |
---|
| 757 | + AEXT_ERROR(dev->name, "kzalloc failed\n"); |
---|
| 758 | + ret = -ENOMEM; |
---|
| 759 | + goto exit; |
---|
| 760 | + } |
---|
| 761 | + |
---|
| 762 | + ret = wl_construct_ctl_chanspec_list(dev, list); |
---|
| 763 | + if (ret < 0) { |
---|
749 | 764 | AEXT_ERROR(dev->name, "get channels failed with %d\n", ret); |
---|
| 765 | + goto exit; |
---|
750 | 766 | } else { |
---|
751 | | - bytes_written = snprintf(command, total_len, "channels"); |
---|
752 | | - for (i = 0; i < dtoh32(list->count); i++) { |
---|
753 | | - bytes_written += snprintf(command+bytes_written, total_len, " %d", |
---|
754 | | - dtoh32(list->element[i])); |
---|
| 767 | + bytes_written = 0; |
---|
| 768 | + for (i = 0; i < list->count; i++) { |
---|
| 769 | + chspec = list->element[i]; |
---|
| 770 | + channel = wf_chspec_ctlchan(chspec); |
---|
| 771 | +#ifdef WL_6G_BAND |
---|
| 772 | + if (CHSPEC_IS6G(chspec) && (channel >= CH_MIN_6G_CHANNEL) && |
---|
| 773 | + (channel <= CH_MAX_6G_CHANNEL)) { |
---|
| 774 | + bytes_written += snprintf(command+bytes_written, total_len, "6g%d ", |
---|
| 775 | + channel); |
---|
| 776 | + } else |
---|
| 777 | +#endif |
---|
| 778 | + { |
---|
| 779 | + bytes_written += snprintf(command+bytes_written, total_len, "%d ", |
---|
| 780 | + channel); |
---|
| 781 | + } |
---|
755 | 782 | } |
---|
756 | 783 | AEXT_TRACE(dev->name, "command result is %s\n", command); |
---|
757 | 784 | ret = bytes_written; |
---|
758 | 785 | } |
---|
759 | 786 | |
---|
| 787 | +exit: |
---|
| 788 | + if (list) |
---|
| 789 | + kfree(list); |
---|
760 | 790 | return ret; |
---|
761 | 791 | } |
---|
762 | 792 | |
---|
.. | .. |
---|
3011 | 3041 | s32 err = BCME_OK; |
---|
3012 | 3042 | |
---|
3013 | 3043 | param.band = band; |
---|
3014 | | - err = wl_ext_iovar_getbuf(net, "bw_cap", ¶m, sizeof(param), buf, |
---|
| 3044 | + err = wldev_iovar_getbuf(net, "bw_cap", ¶m, sizeof(param), buf, |
---|
3015 | 3045 | sizeof(buf), NULL); |
---|
3016 | 3046 | if (err) { |
---|
3017 | 3047 | if (err != BCME_UNSUPPORTED) { |
---|
3018 | | - AEXT_ERROR(net->name, "bw_cap failed, %d\n", err); |
---|
| 3048 | + AEXT_TRACE(net->name, "bw_cap failed, %d\n", err); |
---|
3019 | 3049 | return err; |
---|
3020 | 3050 | } else { |
---|
3021 | 3051 | err = wl_ext_iovar_getint(net, "mimo_bw_cap", &bw_cap); |
---|
.. | .. |
---|
3066 | 3096 | s32 distance_6g; |
---|
3067 | 3097 | #endif /* WL_6G_BAND */ |
---|
3068 | 3098 | s32 cen_ch, distance, distance_2g, distance_5g, chanspec, min_ap=999; |
---|
3069 | | - u8 valid_chan_list[sizeof(u32)*(MAX_CTRL_CHANSPECS + 1)]; |
---|
3070 | | - wl_uint32_list_t *list; |
---|
| 3099 | + wl_uint32_list_t *list = NULL; |
---|
3071 | 3100 | int ret; |
---|
3072 | 3101 | chanspec_t chspec; |
---|
3073 | 3102 | u32 channel; |
---|
.. | .. |
---|
3082 | 3111 | memset(six_g_band8, -1, sizeof(six_g_band8)); |
---|
3083 | 3112 | #endif /* WL_6G_BAND */ |
---|
3084 | 3113 | |
---|
3085 | | - memset(valid_chan_list, 0, sizeof(valid_chan_list)); |
---|
3086 | | - list = (wl_uint32_list_t *)(void *) valid_chan_list; |
---|
| 3114 | + list = kzalloc(sizeof(u32)*(MAX_CTRL_CHANSPECS + 1), GFP_KERNEL); |
---|
| 3115 | + if (list == NULL) { |
---|
| 3116 | + AEXT_ERROR(net->name, "kzalloc failed\n"); |
---|
| 3117 | + ret = -ENOMEM; |
---|
| 3118 | + goto exit; |
---|
| 3119 | + } |
---|
3087 | 3120 | |
---|
3088 | 3121 | ret = wl_construct_ctl_chanspec_list(net, list); |
---|
3089 | 3122 | if (ret < 0) { |
---|
3090 | 3123 | AEXT_ERROR(net->name, "get channels failed with %d\n", ret); |
---|
3091 | | - return 0; |
---|
| 3124 | + goto exit; |
---|
3092 | 3125 | } else { |
---|
3093 | 3126 | for (i = 0; i < list->count; i++) { |
---|
3094 | 3127 | chspec = list->element[i]; |
---|
.. | .. |
---|
3313 | 3346 | } |
---|
3314 | 3347 | |
---|
3315 | 3348 | exit: |
---|
3316 | | - return 0; |
---|
| 3349 | + if (list) |
---|
| 3350 | + kfree(list); |
---|
| 3351 | + return ret; |
---|
3317 | 3352 | } |
---|
3318 | 3353 | #endif /* WL_CFG80211 || WL_ESCAN */ |
---|
3319 | 3354 | |
---|
.. | .. |
---|
3414 | 3449 | kfree(reqbuf); |
---|
3415 | 3450 | } |
---|
3416 | 3451 | |
---|
3417 | | - return channel; |
---|
| 3452 | + return chosen; |
---|
3418 | 3453 | } |
---|
3419 | 3454 | #endif /* WL_CFG80211 */ |
---|
3420 | 3455 | |
---|
.. | .. |
---|
3424 | 3459 | { |
---|
3425 | 3460 | int ret = -1, i, cnt = 0; |
---|
3426 | 3461 | int retry = 0, retry_max, retry_interval = 250, up = 1; |
---|
3427 | | - wl_scan_info_t scan_info; |
---|
| 3462 | + wl_scan_info_t *scan_info = NULL; |
---|
| 3463 | + |
---|
| 3464 | + scan_info = kmalloc(sizeof(wl_scan_info_t), GFP_KERNEL); |
---|
| 3465 | + if (scan_info == NULL) { |
---|
| 3466 | + AEXT_ERROR(dev->name, "kzalloc failed\n"); |
---|
| 3467 | + ret = -ENOMEM; |
---|
| 3468 | + goto exit; |
---|
| 3469 | + } |
---|
3428 | 3470 | |
---|
3429 | 3471 | retry_max = WL_ESCAN_TIMER_INTERVAL_MS/retry_interval; |
---|
3430 | 3472 | ret = wldev_ioctl_get(dev, WLC_GET_UP, &up, sizeof(s32)); |
---|
3431 | 3473 | if (ret < 0 || up == 0) { |
---|
3432 | 3474 | ret = wldev_ioctl_set(dev, WLC_UP, &up, sizeof(s32)); |
---|
3433 | 3475 | } |
---|
3434 | | - memset(&scan_info, 0, sizeof(wl_scan_info_t)); |
---|
| 3476 | + memset(scan_info, 0, sizeof(wl_scan_info_t)); |
---|
3435 | 3477 | if (band == WLC_BAND_2G || band == WLC_BAND_AUTO) { |
---|
3436 | 3478 | for (i=0; i<13; i++) { |
---|
3437 | | - scan_info.channels.channel[i+cnt] = wf_create_chspec_from_primary(i+1, |
---|
| 3479 | + scan_info->channels.channel[i+cnt] = wf_create_chspec_from_primary(i+1, |
---|
3438 | 3480 | WL_CHANSPEC_BW_20, WL_CHANSPEC_BAND_2G); |
---|
3439 | 3481 | } |
---|
3440 | 3482 | cnt += 13; |
---|
3441 | 3483 | } |
---|
3442 | 3484 | if (band == WLC_BAND_5G || band == WLC_BAND_AUTO) { |
---|
3443 | 3485 | for (i=0; i<4; i++) { |
---|
3444 | | - scan_info.channels.channel[i+cnt] = wf_create_chspec_from_primary(36+i*4, |
---|
| 3486 | + scan_info->channels.channel[i+cnt] = wf_create_chspec_from_primary(36+i*4, |
---|
3445 | 3487 | WL_CHANSPEC_BW_20, WL_CHANSPEC_BAND_5G); |
---|
3446 | 3488 | } |
---|
3447 | 3489 | cnt += 4; |
---|
3448 | 3490 | for (i=0; i<4; i++) { |
---|
3449 | | - scan_info.channels.channel[i+cnt] = wf_create_chspec_from_primary(149+i*4, |
---|
| 3491 | + scan_info->channels.channel[i+cnt] = wf_create_chspec_from_primary(149+i*4, |
---|
3450 | 3492 | WL_CHANSPEC_BW_20, WL_CHANSPEC_BAND_5G); |
---|
3451 | 3493 | } |
---|
3452 | 3494 | cnt += 4; |
---|
.. | .. |
---|
3454 | 3496 | #ifdef WL_6G_BAND |
---|
3455 | 3497 | if (band == WLC_BAND_6G || band == WLC_BAND_AUTO) { |
---|
3456 | 3498 | for (i=0; i<59; i++) { |
---|
3457 | | - scan_info.channels.channel[i+cnt] = wf_create_chspec_from_primary(1+i*4, |
---|
| 3499 | + scan_info->channels.channel[i+cnt] = wf_create_chspec_from_primary(1+i*4, |
---|
3458 | 3500 | WL_CHANSPEC_BW_20, WL_CHANSPEC_BAND_6G); |
---|
3459 | 3501 | } |
---|
3460 | 3502 | cnt += 59; |
---|
.. | .. |
---|
3462 | 3504 | #endif /* WL_6G_BAND */ |
---|
3463 | 3505 | if (band == WLC_BAND_2G) |
---|
3464 | 3506 | fast_scan = FALSE; |
---|
3465 | | - scan_info.channels.count = cnt; |
---|
| 3507 | + scan_info->channels.count = cnt; |
---|
3466 | 3508 | if (fast_scan) |
---|
3467 | | - scan_info.scan_time = 40; |
---|
3468 | | - scan_info.bcast_ssid = TRUE; |
---|
| 3509 | + scan_info->scan_time = 40; |
---|
| 3510 | + scan_info->bcast_ssid = TRUE; |
---|
3469 | 3511 | retry = retry_max; |
---|
3470 | 3512 | while (retry--) { |
---|
3471 | | - ret = wl_escan_set_scan(dev, &scan_info); |
---|
| 3513 | + ret = wl_escan_set_scan(dev, scan_info); |
---|
3472 | 3514 | if (!ret) |
---|
3473 | 3515 | break; |
---|
3474 | 3516 | OSL_SLEEP(retry_interval); |
---|
.. | .. |
---|
3478 | 3520 | ret = -1; |
---|
3479 | 3521 | } |
---|
3480 | 3522 | |
---|
| 3523 | +exit: |
---|
| 3524 | + if (scan_info) |
---|
| 3525 | + kfree(scan_info); |
---|
3481 | 3526 | return ret; |
---|
3482 | 3527 | } |
---|
3483 | 3528 | |
---|
3484 | | -int |
---|
| 3529 | +static int |
---|
3485 | 3530 | wl_ext_drv_apcs(struct net_device *dev, uint32 band) |
---|
3486 | 3531 | { |
---|
3487 | | - int ret = 0, channel = 0; |
---|
| 3532 | + int ret = 0, chanspec = 0; |
---|
3488 | 3533 | struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
3489 | 3534 | struct wl_escan_info *escan = NULL; |
---|
3490 | 3535 | int retry = 0, retry_max, retry_interval = 250; |
---|
.. | .. |
---|
3499 | 3544 | retry = retry_max; |
---|
3500 | 3545 | while (retry--) { |
---|
3501 | 3546 | if (escan->escan_state == ESCAN_STATE_IDLE) { |
---|
3502 | | - if (band == WLC_BAND_5G) |
---|
3503 | | - channel = escan->best_5g_ch; |
---|
| 3547 | + if (band == WLC_BAND_5G) { |
---|
| 3548 | + chanspec = wf_create_chspec_from_primary(wf_chspec_primary20_chan(escan->best_5g_ch), |
---|
| 3549 | + WL_CHANSPEC_BW_20, WL_CHANSPEC_BAND_5G); |
---|
| 3550 | + } |
---|
3504 | 3551 | #ifdef WL_6G_BAND |
---|
3505 | | - else if (band == WLC_BAND_6G) |
---|
3506 | | - channel = escan->best_6g_ch; |
---|
| 3552 | + else if (band == WLC_BAND_6G) { |
---|
| 3553 | + chanspec = wf_create_chspec_from_primary(wf_chspec_primary20_chan(escan->best_6g_ch), |
---|
| 3554 | + WL_CHANSPEC_BW_20, WL_CHANSPEC_BAND_6G); |
---|
| 3555 | + } |
---|
3507 | 3556 | #endif /* WL_6G_BAND */ |
---|
3508 | | - else |
---|
3509 | | - channel = escan->best_2g_ch; |
---|
3510 | | - WL_MSG(dev->name, "selected channel = %d\n", channel); |
---|
| 3557 | + else { |
---|
| 3558 | + chanspec = wf_create_chspec_from_primary(wf_chspec_primary20_chan(escan->best_2g_ch), |
---|
| 3559 | + WL_CHANSPEC_BW_20, WL_CHANSPEC_BAND_2G); |
---|
| 3560 | + } |
---|
| 3561 | + WL_MSG(dev->name, "selected channel = %d(0x%x)\n", |
---|
| 3562 | + wf_chspec_ctlchan(chanspec), chanspec); |
---|
3511 | 3563 | goto done; |
---|
3512 | 3564 | } |
---|
3513 | 3565 | AEXT_INFO(dev->name, "escan_state=%d, %d tried, ret = %d\n", |
---|
.. | .. |
---|
3518 | 3570 | done: |
---|
3519 | 3571 | escan->autochannel = 0; |
---|
3520 | 3572 | |
---|
3521 | | - return channel; |
---|
| 3573 | + return chanspec; |
---|
3522 | 3574 | } |
---|
3523 | 3575 | #endif /* WL_ESCAN */ |
---|
3524 | 3576 | |
---|
3525 | 3577 | int |
---|
3526 | 3578 | wl_ext_autochannel(struct net_device *dev, uint acs, uint32 band) |
---|
3527 | 3579 | { |
---|
3528 | | - int channel = 0; |
---|
3529 | | - uint16 chan_2g, chan_5g; |
---|
| 3580 | + int chosen = 0; |
---|
| 3581 | + uint16 chan_2g, chan_5g, channel; |
---|
3530 | 3582 | |
---|
3531 | | - AEXT_INFO(dev->name, "acs=0x%x, band=%d \n", acs, band); |
---|
| 3583 | + AEXT_INFO(dev->name, "acs=0x%x, band=%s\n", acs, WLCBAND2STR(band)); |
---|
3532 | 3584 | |
---|
3533 | 3585 | #ifdef WL_CFG80211 |
---|
3534 | 3586 | if (acs & ACS_FW_BIT) { |
---|
3535 | 3587 | int ret = 0; |
---|
3536 | 3588 | ret = wldev_ioctl_get(dev, WLC_GET_CHANNEL_SEL, &channel, sizeof(channel)); |
---|
3537 | | - channel = 0; |
---|
| 3589 | + chosen = 0; |
---|
3538 | 3590 | if (ret != BCME_UNSUPPORTED) |
---|
3539 | | - channel = wl_ext_fw_apcs(dev, band); |
---|
3540 | | - if (channel) |
---|
3541 | | - return channel; |
---|
| 3591 | + chosen = wl_ext_fw_apcs(dev, band); |
---|
| 3592 | + if (chosen) |
---|
| 3593 | + return chosen; |
---|
3542 | 3594 | } |
---|
3543 | 3595 | #endif |
---|
3544 | 3596 | |
---|
3545 | 3597 | #ifdef WL_ESCAN |
---|
3546 | 3598 | if (acs & ACS_DRV_BIT) |
---|
3547 | | - channel = wl_ext_drv_apcs(dev, band); |
---|
| 3599 | + chosen = wl_ext_drv_apcs(dev, band); |
---|
3548 | 3600 | #endif /* WL_ESCAN */ |
---|
3549 | 3601 | |
---|
3550 | | - if (channel == 0) { |
---|
| 3602 | + if (chosen == 0) { |
---|
3551 | 3603 | wl_ext_get_default_chan(dev, &chan_2g, &chan_5g, TRUE); |
---|
3552 | 3604 | if (band == WLC_BAND_5G) { |
---|
| 3605 | + chosen = wf_create_chspec_from_primary(wf_chspec_primary20_chan(chan_5g), |
---|
| 3606 | + WL_CHANSPEC_BW_20, WL_CHANSPEC_BAND_5G); |
---|
3553 | 3607 | channel = chan_5g; |
---|
3554 | 3608 | } else { |
---|
| 3609 | + chosen = wf_create_chspec_from_primary(wf_chspec_primary20_chan(chan_2g), |
---|
| 3610 | + WL_CHANSPEC_BW_20, WL_CHANSPEC_BAND_2G); |
---|
3555 | 3611 | channel = chan_2g; |
---|
3556 | 3612 | } |
---|
3557 | | - AEXT_ERROR(dev->name, "ACS failed. Fall back to default channel (%d) \n", channel); |
---|
| 3613 | + AEXT_ERROR(dev->name, "ACS failed. Fall back to default channel (%s-%d) \n", |
---|
| 3614 | + CHSPEC2BANDSTR(chosen), channel); |
---|
3558 | 3615 | } |
---|
3559 | 3616 | |
---|
3560 | | - return channel; |
---|
| 3617 | + return chosen; |
---|
3561 | 3618 | } |
---|
3562 | 3619 | |
---|
3563 | 3620 | #if defined(RSSIAVG) |
---|