void suggest_wifi_new_powersave(void) { char sug[1024]; if (wext_sock == -1) { wext_sock = socket(AF_INET, SOCK_DGRAM, 0); if (wext_sock < 0) return; } if (strlen(wireless_nic) == 0) find_wireless_nic(); if (strlen(wireless_nic) == 0) return; if (check_wireless_unused()) { sprintf(sug, _("Suggestion: Disable the unused WIFI radio by setting the interface down:\n " "ifconfig %s down\n"), wireless_nic); } else if (check_wireless_powersave()) { sprintf(sug, _("Suggestion: Enable wireless power saving mode by executing the following command:\n " " iwconfig %s power timeout 500ms\n" "This will sacrifice network performance slightly to save power."), wireless_nic); } }
void suggest_wireless_powersave(void) { char sug[1024]; int ret; if (strlen(wireless_nic)==0) find_wireless_nic(); find_4965(); ret = check_unused_wiresless_up(); if (ret >= 0 && need_wireless_suggest(wireless_nic)) { sprintf(sug, _("Suggestion: Enable wireless power saving mode by executing the following command:\n " " iwpriv %s set_power 5 \n" "This will sacrifice network performance slightly to save power."), wireless_nic); add_suggestion(sug, 20, 'W', _(" W - Enable wireless power saving "), activate_wireless_suggestion); } if (ret >= 0 && need_wireless_suggest_new()) { sprintf(sug, _("Suggestion: Enable wireless power saving mode by executing the following command:\n " " echo 5 > %s \n" "This will sacrifice network performance slightly to save power."), powersave_path); add_suggestion(sug, 20, 'W', _(" W - Enable wireless power saving "), activate_wireless_suggestion_new); } if (ret>0) { sprintf(sug, _("Suggestion: Disable the unused WIFI radio by executing the following command:\n " " echo 1 > %s \n"), rfkill_path); add_suggestion(sug, 60, 'I', _(" I - disable WIFI Radio "), activate_rfkill_suggestion); } }