Author: mzugec Date: Fri Sep 7 13:08:57 2007 New Revision: 40799 URL: http://svn.opensuse.org/viewcvs/yast?rev=40799&view=rev Log: fixed firmware installation for wlan cards (#307401) Modified: trunk/network/VERSION trunk/network/package/yast2-network.changes trunk/network/src/lan/address.ycp trunk/network/src/lan/complex.ycp trunk/network/src/modules/LanItems.ycp Modified: trunk/network/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=40799&r1=40798&r2=40799&view=diff ============================================================================== --- trunk/network/VERSION (original) +++ trunk/network/VERSION Fri Sep 7 13:08:57 2007 @@ -1 +1 @@ -2.15.74 +2.15.75 Modified: trunk/network/package/yast2-network.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.changes?rev=40799&r1=40798&r2=40799&view=diff ============================================================================== --- trunk/network/package/yast2-network.changes (original) +++ trunk/network/package/yast2-network.changes Fri Sep 7 13:08:57 2007 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Sep 7 12:55:00 CEST 2007 - mzugec@suse.cz + +- fixed firmware installation for wlan cards (#307401) +- 2.15.75 + +------------------------------------------------------------------- Thu Sep 6 16:22:18 CEST 2007 - mzugec@suse.cz - fixed missing space between source and destination when copy udev Modified: trunk/network/src/lan/address.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/address.ycp?rev=40799&r1=40798&r2=40799&view=diff ============================================================================== --- trunk/network/src/lan/address.ycp (original) +++ trunk/network/src/lan/address.ycp Fri Sep 7 13:08:57 2007 @@ -567,7 +567,6 @@ }); } - /** * Dialog for setting up IP address * @return dialog result @@ -864,9 +863,10 @@ "abort_button" : Label::CancelButton (), "next_button" : Label::NextButton (), "fallback_functions" : functions, + "disable_buttons" : + (LanItems::operation!=`add ||(LanItems::operation==`edit && LanItems::getCurrentItem()["ifcfg"]:""=="")) ? [ "back_button" ] : [] ]); Wizard::RestoreAbortButton(); - if (LanItems::operation!=`add) Wizard::DisableBackButton (); y2milestone ("ShowAndRun: %1", ret); Modified: trunk/network/src/lan/complex.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/complex.ycp?rev=40799&r1=40798&r2=40799&view=diff ============================================================================== --- trunk/network/src/lan/complex.ycp (original) +++ trunk/network/src/lan/complex.ycp Fri Sep 7 13:08:57 2007 @@ -111,29 +111,7 @@ } define boolean AddInterface () { - //this is the map of kernel modules vs. requested firmware - //non-empty keys are firmware packages shipped by SUSE - map <string, string> request_firmware = $[ - "atmel_pci" : "atmel-firmware", - "atmel_cs" : "atmel-firmware", - "at76_usb" : "atmel-firmware", - "ipw2100" : "ipw-firmware", - "ipw2200" : "ipw-firmware", - "ipw3945" : "ipw-firmware", - "iwl3945" : "iwl3945-ucode", - "iwl4965" : "iwl4965-ucode", - "bcm43xx" : "", - "prism54" : "", - "spectrum_cs" : "", - "zd1201" : "", - "zd1211rw" : "", - "acx" : "", - "rt61pci" : "", - "rt73usb" : "", - "prism54usb":"" - ]; Lan::Add (); - LanItems::SelectHWMap(LanItems::getCurrentItem()["hwinfo"]:$[]); LanItems::Items[LanItems::current, "ifcfg"] = LanItems::getCurrentItem()["hwinfo", "dev_name"]:""; LanItems::Items[LanItems::current, "commited"] = false; @@ -149,15 +127,17 @@ return false; } } - else if(haskey(request_firmware, NetworkModules::Alias)){ - string fw = request_firmware[NetworkModules::Alias]:""; +*/ + if (LanItems::needFirmwareCurrentItem()){ + string fw = LanItems::GetFirmwareForCurrentItem(); if (fw != ""){ if ((!Package::Installed(fw) && !Package::Available(fw))){ Popup::Message(sformat(_("The device needs a firmware to function properly. It can be installed from %1 Add-On CD.\nTo install the firmware, add Add-On CD to your YaST installation sources and return to this configuration dialog."), Product::name)); return false; - } + } else + if (!contains(LanItems::Requires, fw)) LanItems::Requires = add(LanItems::Requires, fw); } else { return (Popup::ContinueCancel(_("The device needs a firmware to function properly. It can be usually downloaded @@ -166,7 +146,7 @@ once you have installed the firmware."))); } } -*/ + // this is one of 3 places to install packages :-( // - kernel modules (InstallKernel): before loaded // - smpppd & kinternet: before net start @@ -176,6 +156,9 @@ if(PackagesInstall(LanItems::Requires) != `next) return false; } +/* + TODO: Refresh hwinfo in LanItems +*/ return true; } @@ -221,12 +204,14 @@ void enableDisableButtons(){ LanItems::current = (integer)UI::QueryWidget (`id (`_hw_items), `CurrentItem); + UI::ChangeWidget(`_hw_sum, `Value,LanItems::GetItemDescription()); if (!LanItems::IsItemConfigured()) // unconfigured UI::ChangeWidget(`id(`delete), `Enabled, false); else UI::ChangeWidget(`id(`delete), `Enabled, true); - if (!hasAnyValue(LanItems::getCurrentItem()["hwinfo", "dev_name"]:"") && size(LanItems::getCurrentItem()["hwinfo"]:$[])>0) UI::ChangeWidget(`id(`edit), `Enabled, false); - else UI::ChangeWidget(`id(`edit), `Enabled, true); + + UI::ChangeWidget(`id(`edit), `Enabled, LanItems::enableCurrentEditButton()); + if (!Mode::config() && Lan::HaveXenBridge ()) // #196479 { // #178848 Modified: trunk/network/src/modules/LanItems.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/LanItems.ycp?rev=40799&r1=40798&r2=40799&view=diff ============================================================================== --- trunk/network/src/modules/LanItems.ycp (original) +++ trunk/network/src/modules/LanItems.ycp Fri Sep 7 13:08:57 2007 @@ -132,6 +132,28 @@ global string nm_name = ""; global string nm_name_old = nil; + //this is the map of kernel modules vs. requested firmware + //non-empty keys are firmware packages shipped by SUSE +map <string, string> request_firmware = $[ + "atmel_pci" : "atmel-firmware", + "atmel_cs" : "atmel-firmware", + "at76_usb" : "atmel-firmware", + "ipw2100" : "ipw-firmware", + "ipw2200" : "ipw-firmware", + "ipw3945" : "ipw-firmware", + "iwl3945" : "iwl3945-ucode", + "iwl4965" : "iwl4965-ucode", + "bcm43xx" : "", + "prism54" : "", + "spectrum_cs" : "", + "zd1201" : "", + "zd1211rw" : "", + "acx" : "", + "rt61pci" : "", + "rt73usb" : "", + "prism54usb":"" + ]; + include "network/hardware.ycp"; boolean ReadUdevRules(){ @@ -1370,5 +1392,43 @@ Items[current, "udev", "driver"] = driver; } +global boolean needFirmwareCurrentItem(){ + boolean need = false; + if (hasAnyValue(getCurrentItem()["hwinfo", "driver"]:"")){ + if(haskey(request_firmware, getCurrentItem()["hwinfo", "driver"]:"")) need = true; + } else{ + foreach(map driver, getCurrentItem()["hwinfo", "drivers"]:[], { + if(haskey(request_firmware, driver["modules", 0,0]:"")) { + y2milestone("driver %1 needs firmware", driver["modules", 0,0]:""); + need = true; + } + }); + } + y2milestone("item %1 needs firmware:%2", current, need); + return need; +} + +global string GetFirmwareForCurrentItem(){ + string kernel_module=""; + if (hasAnyValue(getCurrentItem()["hwinfo", "driver"]:"")){ + if(haskey(request_firmware, getCurrentItem()["hwinfo", "driver"]:"")) kernel_module=getCurrentItem()["hwinfo", "driver"]:""; + } else{ + foreach(map driver, getCurrentItem()["hwinfo", "drivers"]:[], { + if(haskey(request_firmware, driver["modules", 0,0]:"")) { + kernel_module = driver["modules", 0,0]:""; + break; + } + }); + } + string firmware = request_firmware[kernel_module]:""; + y2milestone("driver %1 needs firmware %2", kernel_module, firmware); + return firmware; +} + +global boolean enableCurrentEditButton(){ + if (needFirmwareCurrentItem()) return true; + if (!hasAnyValue(LanItems::getCurrentItem()["hwinfo", "dev_name"]:"") && size(LanItems::getCurrentItem()["hwinfo"]:$[])>0) return false; + else return true; +} } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org