ACC SHELL
/**
* File: include/network/hardware.ycp
* Package: Network configuration
* Summary: Hardware routines
* Authors: Michal Svec <msvec@suse.cz>
*
* $Id: hardware.ycp 43483 2008-01-08 17:49:13Z mzugec $
*
* All hardware settings are stored in a global variable Hardware.
*
* If you want to add a new HW type, you have to do the following steps:
* - add the type to ReadHardware
* - add the type to SelectHardware
* - add the type to ControllerType
*/
{
textdomain "network";
import "Arch";
import "Confirm";
import "Map";
include "network/routines.ycp";
/**
* Select the given hardware item or clean up structures (item == nil)
* @param which item to be chosen
*/
map FindHardware (list Hardware, integer which) {
map sel = $[];
if(which != nil) {
sel = Hardware[which]:$[];
if(which > size(Hardware) || which < 0)
y2error("Item not found in Hardware: %1 (%2)", which, size(Hardware));
}
return sel;
}
/**
* Select the given hardware item
* SelectHardware is a "virtual method", that is named SelectHW in "subclasses"
* like Lan and Modem.
* @param sel item to be chosen
*/
map SelectHardwareMap (map sel) {
/* common stuff */
description = sel["name"]:"";
type = sel["type"]:"eth";
hotplug = sel["hotplug"]:"";
// unique = sel["udi"]:"";
Requires = sel["requires"]:[];
// #44977: Requires now contain the appropriate kernel packages
// but they are handled differently due to multiple kernel flavors
// (see Package::InstallKernel)
// Leave only those not starting with "kernel".
Requires = filter (string r, Requires, ``( search (r, "kernel") != 0 ));
y2milestone ("requires=%1", Requires);
// FIXME: devname
hotplug = "";
return sel;
}
/**
* Select the given hardware item or clean up structures (item == nil)
* @param which item to be chosen
*/
map SelectHardware (list Hardware, integer which) {
return SelectHardwareMap (FindHardware (Hardware, which));
}
/* modem * /
if(type == "modem") {
Init1 = sel["init1"]:"";
Init2 = sel["init2"]:"";
Device = sel["device_name"]:"";
BaudRate = sel["speed"]:57600;
PPPDoptions = sel["pppd_options"]:"";
Requires = sel["requires"]:[];
type = "modem";
}
/* isdn card * /
else if(type == "isdn") {
/* FIXME: ISDN * /
y2error("isdn not ready yet");
}
/* dsl card * /
else if(type == "dsl") {
/* FIXME: DSL HW * /
pppmode = sel["pppmode"]:"capi-adsl";
startmode = sel["startmode"]:"manual";
}
/* treat the rest as a network card * /
else {
/* don't make modprobe.conf entries for hotpluggable HW (29547) * /
if(hotplug == "") {
Module["module"] = sel["module"]:"";
Module["options"] = sel["options"]:"";
}
else
y2debug("HOTPLUG(%1) -> ignoring modprobe.conf", hotplug);
}
device = GetFreeDevice(NetworkInterfaces::RealType(type, hotplug));
}
*/
/* EOF */
}
ACC SHELL 2018