conf->channel = intval;
if ((intval = ucv_int64_get(ucv_object_get(info, "sec_channel", NULL))) && !errno)
conf->secondary_channel = intval;
- if ((intval = ucv_int64_get(ucv_object_get(info, "center_seg0_idx", NULL))) && !errno)
+
+ intval = ucv_int64_get(ucv_object_get(info, "center_seg0_idx", NULL));
+ if (!errno)
hostapd_set_oper_centr_freq_seg0_idx(conf, intval);
- if ((intval = ucv_int64_get(ucv_object_get(info, "center_seg1_idx", NULL))) && !errno)
+
+ intval = ucv_int64_get(ucv_object_get(info, "center_seg1_idx", NULL));
+ if (!errno)
hostapd_set_oper_centr_freq_seg1_idx(conf, intval);
+
intval = ucv_int64_get(ucv_object_get(info, "oper_chwidth", NULL));
if (!errno)
hostapd_set_oper_chwidth(conf, intval);
tmp_channel &= ~((8 << width) - 1);
center_idx = tmp_channel + center_ofs + (4 << width) - 1;
- ucv_object_add(ret, "center_seg0_idx", ucv_int64_new(center_idx));
+ if (freq_val < 3000)
+ ucv_object_add(ret, "center_seg0_idx", ucv_int64_new(0));
+ else
+ ucv_object_add(ret, "center_seg0_idx", ucv_int64_new(center_idx));
center_idx = (center_idx - channel) * 5 + freq_val;
ucv_object_add(ret, "center_freq1", ucv_int64_new(center_idx));