logging: remove LOGD_HW alias for LOGD_PLATFORM

Since commit 1495853e01, LOGD_HW is renamed to
LOGD_PLATFORM. Remove the internal usage of the deprecated name.

Backport this patch to nm-1-4 because it avoids follow-up conflicts with
future backports. Also, it is a really trivial change, meaning, we only
replace the obsolte LOGD_HW name.

(cherry picked from commit 64951f07fb)

Conflicts:
    src/devices/nm-device.c
    src/devices/wwan/nm-modem.c
This commit is contained in:
Thomas Haller 2016-10-06 21:28:40 +02:00
parent 4d89a986ad
commit a67eb9d8d0
18 changed files with 79 additions and 80 deletions

View file

@ -68,7 +68,7 @@ dev_get_attrs (GUdevDevice *udev_device,
path = g_udev_device_get_sysfs_path (udev_device); path = g_udev_device_get_sysfs_path (udev_device);
if (!path) { if (!path) {
nm_log_warn (LOGD_HW, "couldn't determine device path; ignoring..."); nm_log_warn (LOGD_PLATFORM, "couldn't determine device path; ignoring...");
return FALSE; return FALSE;
} }
@ -110,11 +110,11 @@ adsl_add (NMAtmManager *self, GUdevDevice *udev_device)
ifname = g_udev_device_get_name (udev_device); ifname = g_udev_device_get_name (udev_device);
if (!ifname) { if (!ifname) {
nm_log_warn (LOGD_HW, "failed to get device's interface name"); nm_log_warn (LOGD_PLATFORM, "failed to get device's interface name");
return; return;
} }
nm_log_dbg (LOGD_HW, "(%s): found ATM device", ifname); nm_log_dbg (LOGD_PLATFORM, "(%s): found ATM device", ifname);
atm_index_path = g_strdup_printf ("/sys/class/atm/%s/atmindex", atm_index_path = g_strdup_printf ("/sys/class/atm/%s/atmindex",
NM_ASSERT_VALID_PATH_COMPONENT (ifname)); NM_ASSERT_VALID_PATH_COMPONENT (ifname));
@ -123,12 +123,12 @@ adsl_add (NMAtmManager *self, GUdevDevice *udev_device)
10, 0, G_MAXINT, 10, 0, G_MAXINT,
-1); -1);
if (atm_index < 0) { if (atm_index < 0) {
nm_log_warn (LOGD_HW, "(%s): failed to get ATM index", ifname); nm_log_warn (LOGD_PLATFORM, "(%s): failed to get ATM index", ifname);
return; return;
} }
if (!dev_get_attrs (udev_device, &sysfs_path, &driver)) { if (!dev_get_attrs (udev_device, &sysfs_path, &driver)) {
nm_log_warn (LOGD_HW, "(%s): failed to get ATM attributes", ifname); nm_log_warn (LOGD_PLATFORM, "(%s): failed to get ATM attributes", ifname);
return; return;
} }
@ -153,7 +153,7 @@ adsl_remove (NMAtmManager *self, GUdevDevice *udev_device)
const char *iface = g_udev_device_get_name (udev_device); const char *iface = g_udev_device_get_name (udev_device);
GSList *iter; GSList *iter;
nm_log_dbg (LOGD_HW, "(%s): removing ATM device", iface); nm_log_dbg (LOGD_PLATFORM, "(%s): removing ATM device", iface);
for (iter = priv->devices; iter; iter = iter->next) { for (iter = priv->devices; iter; iter = iter->next) {
NMDevice *device = iter->data; NMDevice *device = iter->data;
@ -210,7 +210,7 @@ handle_uevent (GUdevClient *client,
ifindex = g_udev_device_get_property (device, "IFINDEX"); ifindex = g_udev_device_get_property (device, "IFINDEX");
seqnum = g_udev_device_get_seqnum (device); seqnum = g_udev_device_get_seqnum (device);
nm_log_dbg (LOGD_HW, "UDEV event: action '%s' subsys '%s' device '%s' (%s); seqnum=%" G_GUINT64_FORMAT, nm_log_dbg (LOGD_PLATFORM, "UDEV event: action '%s' subsys '%s' device '%s' (%s); seqnum=%" G_GUINT64_FORMAT,
action, subsys, g_udev_device_get_name (device), ifindex ? ifindex : "unknown", seqnum); action, subsys, g_udev_device_get_name (device), ifindex ? ifindex : "unknown", seqnum);
if (!strcmp (action, "add")) if (!strcmp (action, "add"))

View file

@ -129,7 +129,7 @@ set_bond_attr (NMDevice *device, NMBondMode mode, const char *attr, const char *
ret = nm_platform_sysctl_master_set_option (NM_PLATFORM_GET, ifindex, attr, value); ret = nm_platform_sysctl_master_set_option (NM_PLATFORM_GET, ifindex, attr, value);
if (!ret) if (!ret)
_LOGW (LOGD_HW, "failed to set bonding attribute '%s' to '%s'", attr, value); _LOGW (LOGD_PLATFORM, "failed to set bonding attribute '%s' to '%s'", attr, value);
return ret; return ret;
} }

View file

@ -188,7 +188,7 @@ _update_s390_subchannels (NMDeviceEthernet *self)
parent_path = g_udev_device_get_sysfs_path (parent); parent_path = g_udev_device_get_sysfs_path (parent);
dir = g_dir_open (parent_path, 0, &error); dir = g_dir_open (parent_path, 0, &error);
if (!dir) { if (!dir) {
_LOGW (LOGD_DEVICE | LOGD_HW, "update-s390: failed to open directory '%s': %s", _LOGW (LOGD_DEVICE | LOGD_PLATFORM, "update-s390: failed to open directory '%s': %s",
parent_path, error->message); parent_path, error->message);
g_clear_error (&error); g_clear_error (&error);
return; return;
@ -218,11 +218,11 @@ _update_s390_subchannels (NMDeviceEthernet *self)
g_hash_table_insert (priv->s390_options, g_strdup (item), value); g_hash_table_insert (priv->s390_options, g_strdup (item), value);
value = NULL; value = NULL;
} else } else
_LOGW (LOGD_DEVICE | LOGD_HW, "update-s390: error reading %s", path); _LOGW (LOGD_DEVICE | LOGD_PLATFORM, "update-s390: error reading %s", path);
} }
if (error) { if (error) {
_LOGW (LOGD_DEVICE | LOGD_HW, "update-s390: failed reading sysfs for %s (%s)", item, error->message); _LOGW (LOGD_DEVICE | LOGD_PLATFORM, "update-s390: failed reading sysfs for %s (%s)", item, error->message);
g_clear_error (&error); g_clear_error (&error);
} }
} }
@ -247,7 +247,7 @@ _update_s390_subchannels (NMDeviceEthernet *self)
priv->subchannels_dbus[2] = g_strdup (priv->subchan3); priv->subchannels_dbus[2] = g_strdup (priv->subchan3);
priv->subchannels_dbus[3] = NULL; priv->subchannels_dbus[3] = NULL;
_LOGI (LOGD_DEVICE | LOGD_HW, "update-s390: found s390 '%s' subchannels [%s]", _LOGI (LOGD_DEVICE | LOGD_PLATFORM, "update-s390: found s390 '%s' subchannels [%s]",
nm_device_get_driver ((NMDevice *) self) ?: "(unknown driver)", nm_device_get_driver ((NMDevice *) self) ?: "(unknown driver)",
priv->subchannels); priv->subchannels);
@ -311,7 +311,7 @@ get_generic_capabilities (NMDevice *device)
if (nm_platform_link_supports_carrier_detect (NM_PLATFORM_GET, nm_device_get_ifindex (device))) if (nm_platform_link_supports_carrier_detect (NM_PLATFORM_GET, nm_device_get_ifindex (device)))
return NM_DEVICE_CAP_CARRIER_DETECT; return NM_DEVICE_CAP_CARRIER_DETECT;
else { else {
_LOGI (LOGD_HW, "driver '%s' does not support carrier detection.", _LOGI (LOGD_PLATFORM, "driver '%s' does not support carrier detection.",
nm_device_get_driver (device)); nm_device_get_driver (device));
return NM_DEVICE_CAP_NONE; return NM_DEVICE_CAP_NONE;
} }
@ -1324,7 +1324,7 @@ deactivate (NMDevice *device)
s_dcb = (NMSettingDcb *) nm_device_get_applied_setting (device, NM_TYPE_SETTING_DCB); s_dcb = (NMSettingDcb *) nm_device_get_applied_setting (device, NM_TYPE_SETTING_DCB);
if (s_dcb) { if (s_dcb) {
if (!nm_dcb_cleanup (nm_device_get_iface (device), &error)) { if (!nm_dcb_cleanup (nm_device_get_iface (device), &error)) {
_LOGW (LOGD_DEVICE | LOGD_HW, "failed to disable DCB/FCoE: %s", _LOGW (LOGD_DEVICE | LOGD_PLATFORM, "failed to disable DCB/FCoE: %s",
error->message); error->message);
g_clear_error (&error); g_clear_error (&error);
} }
@ -1529,7 +1529,7 @@ get_link_speed (NMDevice *device)
priv->speed = speed; priv->speed = speed;
_notify (self, PROP_SPEED); _notify (self, PROP_SPEED);
_LOGD (LOGD_HW | LOGD_ETHER, "speed is now %d Mb/s", speed); _LOGD (LOGD_PLATFORM | LOGD_ETHER, "speed is now %d Mb/s", speed);
} }
static void static void

View file

@ -369,7 +369,7 @@ read_device_factory_paths (void)
dir = g_dir_open (NMPLUGINDIR, 0, &error); dir = g_dir_open (NMPLUGINDIR, 0, &error);
if (!dir) { if (!dir) {
nm_log_warn (LOGD_HW, "device plugin: failed to open directory %s: %s", nm_log_warn (LOGD_PLATFORM, "device plugin: failed to open directory %s: %s",
NMPLUGINDIR, NMPLUGINDIR,
error->message); error->message);
g_clear_error (&error); g_clear_error (&error);
@ -391,17 +391,17 @@ read_device_factory_paths (void)
if (stat (data.path, &data.st) != 0) { if (stat (data.path, &data.st) != 0) {
errsv = errno; errsv = errno;
nm_log_warn (LOGD_HW, "device plugin: skip invalid file %s (error during stat: %s)", data.path, strerror (errsv)); nm_log_warn (LOGD_PLATFORM, "device plugin: skip invalid file %s (error during stat: %s)", data.path, strerror (errsv));
goto NEXT; goto NEXT;
} }
if (!S_ISREG (data.st.st_mode)) if (!S_ISREG (data.st.st_mode))
goto NEXT; goto NEXT;
if (data.st.st_uid != 0) { if (data.st.st_uid != 0) {
nm_log_warn (LOGD_HW, "device plugin: skip invalid file %s (file must be owned by root)", data.path); nm_log_warn (LOGD_PLATFORM, "device plugin: skip invalid file %s (file must be owned by root)", data.path);
goto NEXT; goto NEXT;
} }
if (data.st.st_mode & (S_IWGRP | S_IWOTH | S_ISUID)) { if (data.st.st_mode & (S_IWGRP | S_IWOTH | S_ISUID)) {
nm_log_warn (LOGD_HW, "device plugin: skip invalid file %s (invalid file permissions)", data.path); nm_log_warn (LOGD_PLATFORM, "device plugin: skip invalid file %s (invalid file permissions)", data.path);
goto NEXT; goto NEXT;
} }
@ -443,7 +443,7 @@ _add_factory (NMDeviceFactory *factory,
if (check_duplicates) { if (check_duplicates) {
found = find_factory (link_types, setting_types); found = find_factory (link_types, setting_types);
if (found) { if (found) {
nm_log_warn (LOGD_HW, "Loading device plugin failed: multiple plugins " nm_log_warn (LOGD_PLATFORM, "Loading device plugin failed: multiple plugins "
"for same type (using '%s' instead of '%s')", "for same type (using '%s' instead of '%s')",
(char *) g_object_get_data (G_OBJECT (found), PLUGIN_PATH_TAG), (char *) g_object_get_data (G_OBJECT (found), PLUGIN_PATH_TAG),
path); path);
@ -459,7 +459,7 @@ _add_factory (NMDeviceFactory *factory,
callback (factory, user_data); callback (factory, user_data);
nm_log_info (LOGD_HW, "Loaded device plugin: %s (%s)", G_OBJECT_TYPE_NAME (factory), path); nm_log_info (LOGD_PLATFORM, "Loaded device plugin: %s (%s)", G_OBJECT_TYPE_NAME (factory), path);
return TRUE; return TRUE;
} }
@ -502,12 +502,12 @@ nm_device_factory_manager_load_factories (NMDeviceFactoryManagerFactoryFunc call
plugin = g_module_open (*path, G_MODULE_BIND_LOCAL); plugin = g_module_open (*path, G_MODULE_BIND_LOCAL);
if (!plugin) { if (!plugin) {
nm_log_warn (LOGD_HW, "(%s): failed to load plugin: %s", item, g_module_error ()); nm_log_warn (LOGD_PLATFORM, "(%s): failed to load plugin: %s", item, g_module_error ());
continue; continue;
} }
if (!g_module_symbol (plugin, "nm_device_factory_create", (gpointer) &create_func)) { if (!g_module_symbol (plugin, "nm_device_factory_create", (gpointer) &create_func)) {
nm_log_warn (LOGD_HW, "(%s): failed to find device factory creator: %s", item, g_module_error ()); nm_log_warn (LOGD_PLATFORM, "(%s): failed to find device factory creator: %s", item, g_module_error ());
g_module_close (plugin); g_module_close (plugin);
continue; continue;
} }
@ -518,7 +518,7 @@ nm_device_factory_manager_load_factories (NMDeviceFactoryManagerFactoryFunc call
factory = create_func (&error); factory = create_func (&error);
if (!factory) { if (!factory) {
nm_log_warn (LOGD_HW, "(%s): failed to initialize device factory: %s", nm_log_warn (LOGD_PLATFORM, "(%s): failed to initialize device factory: %s",
item, NM_G_ERROR_MSG (error)); item, NM_G_ERROR_MSG (error));
g_clear_error (&error); g_clear_error (&error);
continue; continue;

View file

@ -160,7 +160,7 @@ clear:
lnk = nm_platform_link_get_lnk_gre (NM_PLATFORM_GET, ifindex, NULL); lnk = nm_platform_link_get_lnk_gre (NM_PLATFORM_GET, ifindex, NULL);
if (!lnk) { if (!lnk) {
_LOGW (LOGD_HW, "could not read %s properties", "gre"); _LOGW (LOGD_PLATFORM, "could not read %s properties", "gre");
goto clear; goto clear;
} }
@ -205,7 +205,7 @@ clear:
lnk = nm_platform_link_get_lnk_sit (NM_PLATFORM_GET, ifindex, NULL); lnk = nm_platform_link_get_lnk_sit (NM_PLATFORM_GET, ifindex, NULL);
if (!lnk) { if (!lnk) {
_LOGW (LOGD_HW, "could not read %s properties", "sit"); _LOGW (LOGD_PLATFORM, "could not read %s properties", "sit");
goto clear; goto clear;
} }
@ -220,7 +220,7 @@ clear:
lnk = nm_platform_link_get_lnk_ipip (NM_PLATFORM_GET, ifindex, NULL); lnk = nm_platform_link_get_lnk_ipip (NM_PLATFORM_GET, ifindex, NULL);
if (!lnk) { if (!lnk) {
_LOGW (LOGD_HW, "could not read %s properties", "ipip"); _LOGW (LOGD_PLATFORM, "could not read %s properties", "ipip");
goto clear; goto clear;
} }
@ -236,7 +236,7 @@ clear:
lnk = nm_platform_link_get_lnk_ip6tnl (NM_PLATFORM_GET, ifindex, NULL); lnk = nm_platform_link_get_lnk_ip6tnl (NM_PLATFORM_GET, ifindex, NULL);
if (!lnk) { if (!lnk) {
_LOGW (LOGD_HW, "could not read %s properties", "ip6tnl"); _LOGW (LOGD_PLATFORM, "could not read %s properties", "ip6tnl");
goto clear; goto clear;
} }

View file

@ -180,7 +180,7 @@ update_properties (NMDevice *device)
props = nm_platform_link_get_lnk_macvlan (NM_PLATFORM_GET, nm_device_get_ifindex (device), &plink); props = nm_platform_link_get_lnk_macvlan (NM_PLATFORM_GET, nm_device_get_ifindex (device), &plink);
if (!props) { if (!props) {
_LOGW (LOGD_HW, "could not get %s properties", priv->props.tap ? "macvtap" : "macvlan"); _LOGW (LOGD_PLATFORM, "could not get %s properties", priv->props.tap ? "macvtap" : "macvlan");
return; return;
} }

View file

@ -171,7 +171,7 @@ update_connection (NMDevice *device, NMConnection *connection)
} }
if (!nm_platform_link_tun_get_properties (NM_PLATFORM_GET, nm_device_get_ifindex (device), &props)) { if (!nm_platform_link_tun_get_properties (NM_PLATFORM_GET, nm_device_get_ifindex (device), &props)) {
_LOGW (LOGD_HW, "failed to get TUN interface info while updating connection."); _LOGW (LOGD_PLATFORM, "failed to get TUN interface info while updating connection.");
return; return;
} }

View file

@ -91,7 +91,7 @@ get_peer (NMDeviceVeth *self)
return priv->peer; return priv->peer;
if (!nm_platform_link_veth_get_properties (NM_PLATFORM_GET, nm_device_get_ifindex (device), &peer_ifindex)) { if (!nm_platform_link_veth_get_properties (NM_PLATFORM_GET, nm_device_get_ifindex (device), &peer_ifindex)) {
_LOGW (LOGD_HW, "could not read veth properties"); _LOGW (LOGD_PLATFORM, "could not read veth properties");
return NULL; return NULL;
} }

View file

@ -84,7 +84,7 @@ update_properties (NMDevice *device)
props = nm_platform_link_get_lnk_vxlan (NM_PLATFORM_GET, nm_device_get_ifindex (device), NULL); props = nm_platform_link_get_lnk_vxlan (NM_PLATFORM_GET, nm_device_get_ifindex (device), NULL);
if (!props) { if (!props) {
_LOGW (LOGD_HW, "could not get vxlan properties"); _LOGW (LOGD_PLATFORM, "could not get vxlan properties");
return; return;
} }

View file

@ -756,7 +756,7 @@ nm_device_set_ip_iface (NMDevice *self, const char *iface)
nm_platform_link_set_up (NM_PLATFORM_GET, priv->ip_ifindex, NULL); nm_platform_link_set_up (NM_PLATFORM_GET, priv->ip_ifindex, NULL);
} else { } else {
/* Device IP interface must always be a kernel network interface */ /* Device IP interface must always be a kernel network interface */
_LOGW (LOGD_HW, "failed to look up interface index"); _LOGW (LOGD_PLATFORM, "failed to look up interface index");
} }
} }
@ -899,7 +899,7 @@ get_ip_iface_identifier (NMDevice *self, NMUtilsIPv6IfaceId *out_iid)
priv->dev_id, priv->dev_id,
out_iid); out_iid);
if (!success) { if (!success) {
_LOGW (LOGD_HW, "failed to generate interface identifier " _LOGW (LOGD_PLATFORM, "failed to generate interface identifier "
"for link type %u hwaddr_len %u", pllink->type, (unsigned) pllink->addr.len); "for link type %u hwaddr_len %u", pllink->type, (unsigned) pllink->addr.len);
} }
return success; return success;
@ -2298,7 +2298,7 @@ realize_start_setup (NMDevice *self, const NMPlatformLink *plink)
if (nm_device_has_capability (self, NM_DEVICE_CAP_CARRIER_DETECT)) { if (nm_device_has_capability (self, NM_DEVICE_CAP_CARRIER_DETECT)) {
check_carrier (self); check_carrier (self);
_LOGD (LOGD_HW, _LOGD (LOGD_PLATFORM,
"carrier is %s%s", "carrier is %s%s",
priv->carrier ? "ON" : "OFF", priv->carrier ? "ON" : "OFF",
priv->ignore_carrier ? " (but ignored)" : ""); priv->ignore_carrier ? " (but ignored)" : "");
@ -9033,7 +9033,7 @@ nm_device_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware)
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
_LOGD (LOGD_HW, "bringing up device"); _LOGD (LOGD_PLATFORM, "bringing up device");
if (NM_DEVICE_GET_CLASS (self)->bring_up) { if (NM_DEVICE_GET_CLASS (self)->bring_up) {
if (!NM_DEVICE_GET_CLASS (self)->bring_up (self, no_firmware)) if (!NM_DEVICE_GET_CLASS (self)->bring_up (self, no_firmware))
@ -9059,9 +9059,9 @@ nm_device_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware)
if (!device_is_up) { if (!device_is_up) {
if (block) if (block)
_LOGW (LOGD_HW, "device not up after timeout!"); _LOGW (LOGD_PLATFORM, "device not up after timeout!");
else else
_LOGD (LOGD_HW, "device not up immediately"); _LOGD (LOGD_PLATFORM, "device not up immediately");
return FALSE; return FALSE;
} }
@ -9125,7 +9125,7 @@ nm_device_take_down (NMDevice *self, gboolean block)
g_return_if_fail (NM_IS_DEVICE (self)); g_return_if_fail (NM_IS_DEVICE (self));
_LOGD (LOGD_HW, "taking down device"); _LOGD (LOGD_PLATFORM, "taking down device");
if (NM_DEVICE_GET_CLASS (self)->take_down) { if (NM_DEVICE_GET_CLASS (self)->take_down) {
if (!NM_DEVICE_GET_CLASS (self)->take_down (self)) if (!NM_DEVICE_GET_CLASS (self)->take_down (self))
@ -9147,9 +9147,9 @@ nm_device_take_down (NMDevice *self, gboolean block)
if (device_is_up) { if (device_is_up) {
if (block) if (block)
_LOGW (LOGD_HW, "device not down after timeout!"); _LOGW (LOGD_PLATFORM, "device not down after timeout!");
else else
_LOGD (LOGD_HW, "device not down immediately"); _LOGD (LOGD_PLATFORM, "device not down immediately");
} }
} }
@ -9162,7 +9162,7 @@ take_down (NMDevice *self)
return nm_platform_link_set_down (NM_PLATFORM_GET, ifindex); return nm_platform_link_set_down (NM_PLATFORM_GET, ifindex);
/* devices without ifindex are always up. */ /* devices without ifindex are always up. */
_LOGD (LOGD_HW, "cannot take down device without ifindex"); _LOGD (LOGD_PLATFORM, "cannot take down device without ifindex");
return FALSE; return FALSE;
} }
@ -11150,7 +11150,7 @@ _set_state_full (NMDevice *self,
if (reason != NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) { if (reason != NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) {
if (old_state == NM_DEVICE_STATE_UNMANAGED || priv->firmware_missing) { if (old_state == NM_DEVICE_STATE_UNMANAGED || priv->firmware_missing) {
if (!nm_device_bring_up (self, TRUE, &no_firmware) && no_firmware) if (!nm_device_bring_up (self, TRUE, &no_firmware) && no_firmware)
_LOGW (LOGD_HW, "firmware may be missing."); _LOGW (LOGD_PLATFORM, "firmware may be missing.");
nm_device_set_firmware_missing (self, no_firmware ? TRUE : FALSE); nm_device_set_firmware_missing (self, no_firmware ? TRUE : FALSE);
} }
@ -11533,7 +11533,7 @@ nm_device_update_hw_address (NMDevice *self)
g_free (priv->hw_addr); g_free (priv->hw_addr);
priv->hw_addr = nm_utils_hwaddr_ntoa (hwaddr, hwaddrlen); priv->hw_addr = nm_utils_hwaddr_ntoa (hwaddr, hwaddrlen);
_LOGD (LOGD_HW | LOGD_DEVICE, "hw-addr: hardware address now %s", priv->hw_addr); _LOGD (LOGD_PLATFORM | LOGD_DEVICE, "hw-addr: hardware address now %s", priv->hw_addr);
_notify (self, PROP_HW_ADDRESS); _notify (self, PROP_HW_ADDRESS);
if ( !priv->hw_addr_initial if ( !priv->hw_addr_initial
@ -11550,11 +11550,11 @@ nm_device_update_hw_address (NMDevice *self)
} else { } else {
/* Invalid or no hardware address */ /* Invalid or no hardware address */
if (priv->hw_addr_len != 0) { if (priv->hw_addr_len != 0) {
_LOGD (LOGD_HW | LOGD_DEVICE, _LOGD (LOGD_PLATFORM | LOGD_DEVICE,
"hw-addr: failed reading current MAC address (stay with %s)", "hw-addr: failed reading current MAC address (stay with %s)",
priv->hw_addr); priv->hw_addr);
} else { } else {
_LOGD (LOGD_HW | LOGD_DEVICE, _LOGD (LOGD_PLATFORM | LOGD_DEVICE,
"hw-addr: failed reading current MAC address"); "hw-addr: failed reading current MAC address");
} }
} }
@ -11614,7 +11614,7 @@ nm_device_update_permanent_hw_address (NMDevice *self)
* *
* In some cases it might be necessary to know whether this is a "real" or * In some cases it might be necessary to know whether this is a "real" or
* a temporary address (fake). */ * a temporary address (fake). */
_LOGD (LOGD_HW | LOGD_ETHER, "hw-addr: %s (use current: %s)", _LOGD (LOGD_PLATFORM | LOGD_ETHER, "hw-addr: %s (use current: %s)",
success_read success_read
? "read HW addr length of permanent MAC address differs" ? "read HW addr length of permanent MAC address differs"
: "unable to read permanent MAC address", : "unable to read permanent MAC address",

View file

@ -203,7 +203,7 @@ constructed (GObject *object)
G_OBJECT_CLASS (nm_device_wifi_parent_class)->constructed (object); G_OBJECT_CLASS (nm_device_wifi_parent_class)->constructed (object);
if (priv->capabilities & NM_WIFI_DEVICE_CAP_AP) if (priv->capabilities & NM_WIFI_DEVICE_CAP_AP)
_LOGI (LOGD_HW | LOGD_WIFI, "driver supports Access Point (AP) mode"); _LOGI (LOGD_PLATFORM | LOGD_WIFI, "driver supports Access Point (AP) mode");
/* Connect to the supplicant manager */ /* Connect to the supplicant manager */
priv->sup_mgr = g_object_ref (nm_supplicant_manager_get ()); priv->sup_mgr = g_object_ref (nm_supplicant_manager_get ());

View file

@ -76,7 +76,7 @@ create_device (NMDeviceFactory *factory,
if (!nm_platform_wifi_get_capabilities (NM_PLATFORM_GET, if (!nm_platform_wifi_get_capabilities (NM_PLATFORM_GET,
plink->ifindex, plink->ifindex,
&capabilities)) { &capabilities)) {
nm_log_warn (LOGD_HW | LOGD_WIFI, "(%s) failed to initialize Wi-Fi driver for ifindex %d", iface, plink->ifindex); nm_log_warn (LOGD_PLATFORM | LOGD_WIFI, "(%s) failed to initialize Wi-Fi driver for ifindex %d", iface, plink->ifindex);
return NULL; return NULL;
} }

View file

@ -1355,12 +1355,12 @@ constructor (GType type,
priv = NM_MODEM_GET_PRIVATE (object); priv = NM_MODEM_GET_PRIVATE (object);
if (!priv->data_port && !priv->control_port) { if (!priv->data_port && !priv->control_port) {
nm_log_err (LOGD_HW, "neither modem command nor data interface provided"); nm_log_err (LOGD_PLATFORM, "neither modem command nor data interface provided");
goto err; goto err;
} }
if (!priv->path) { if (!priv->path) {
nm_log_err (LOGD_HW, "D-Bus path not provided"); nm_log_err (LOGD_PLATFORM, "D-Bus path not provided");
goto err; goto err;
} }

View file

@ -78,7 +78,6 @@ typedef enum { /*< skip >*/
/* aliases: */ /* aliases: */
LOGD_DHCP = LOGD_DHCP4 | LOGD_DHCP6, LOGD_DHCP = LOGD_DHCP4 | LOGD_DHCP6,
LOGD_IP = LOGD_IP4 | LOGD_IP6, LOGD_IP = LOGD_IP4 | LOGD_IP6,
LOGD_HW = LOGD_PLATFORM,
} NMLogDomain; } NMLogDomain;
/* Log levels */ /* Log levels */

View file

@ -2127,10 +2127,10 @@ platform_link_added (NMManager *self,
device = nm_device_factory_create_device (factory, plink->name, plink, NULL, &ignore, &error); device = nm_device_factory_create_device (factory, plink->name, plink, NULL, &ignore, &error);
if (!device) { if (!device) {
if (!ignore) { if (!ignore) {
_LOGW (LOGD_HW, "%s: factory failed to create device: %s", _LOGW (LOGD_PLATFORM, "%s: factory failed to create device: %s",
plink->name, error->message); plink->name, error->message);
} else { } else {
_LOGD (LOGD_HW, "%s: factory failed to create device: %s", _LOGD (LOGD_PLATFORM, "%s: factory failed to create device: %s",
plink->name, error->message); plink->name, error->message);
} }
return; return;
@ -2144,7 +2144,7 @@ platform_link_added (NMManager *self,
case NM_LINK_TYPE_OLPC_MESH: case NM_LINK_TYPE_OLPC_MESH:
case NM_LINK_TYPE_TEAM: case NM_LINK_TYPE_TEAM:
case NM_LINK_TYPE_WIFI: case NM_LINK_TYPE_WIFI:
_LOGI (LOGD_HW, "(%s): '%s' plugin not available; creating generic device", _LOGI (LOGD_PLATFORM, "(%s): '%s' plugin not available; creating generic device",
plink->name, nm_link_type_to_string (plink->type)); plink->name, nm_link_type_to_string (plink->type));
nm_plugin_missing = TRUE; nm_plugin_missing = TRUE;
/* fall through */ /* fall through */

View file

@ -347,7 +347,7 @@ handle_uevent (GUdevClient *client,
subsys = g_udev_device_get_subsystem (device); subsys = g_udev_device_get_subsystem (device);
g_return_if_fail (!g_strcmp0 (subsys, "rfkill")); g_return_if_fail (!g_strcmp0 (subsys, "rfkill"));
nm_log_dbg (LOGD_HW, "udev rfkill event: action '%s' device '%s'", nm_log_dbg (LOGD_PLATFORM, "udev rfkill event: action '%s' device '%s'",
action, g_udev_device_get_name (device)); action, g_udev_device_get_name (device));
if (!strcmp (action, "add")) if (!strcmp (action, "add"))

View file

@ -1003,7 +1003,7 @@ static int nl80211_wiphy_info_handler (struct nl_msg *msg, void *arg)
case WLAN_CIPHER_SUITE_SMS4: case WLAN_CIPHER_SUITE_SMS4:
break; break;
default: default:
nm_log_dbg (LOGD_HW | LOGD_WIFI, "Don't know the meaning of NL80211_ATTR_CIPHER_SUITE %#8.8x.", ciphers[i]); nm_log_dbg (LOGD_PLATFORM | LOGD_WIFI, "Don't know the meaning of NL80211_ATTR_CIPHER_SUITE %#8.8x.", ciphers[i]);
break; break;
} }
} }
@ -1071,42 +1071,42 @@ wifi_nl80211_init (const char *iface, int ifindex)
if (nl80211_send_and_recv (nl80211, msg, nl80211_wiphy_info_handler, if (nl80211_send_and_recv (nl80211, msg, nl80211_wiphy_info_handler,
&device_info) < 0) { &device_info) < 0) {
nm_log_dbg (LOGD_HW | LOGD_WIFI, nm_log_dbg (LOGD_PLATFORM | LOGD_WIFI,
"(%s): NL80211_CMD_GET_WIPHY request failed", "(%s): NL80211_CMD_GET_WIPHY request failed",
nl80211->parent.iface); nl80211->parent.iface);
goto error; goto error;
} }
if (!device_info.success) { if (!device_info.success) {
nm_log_dbg (LOGD_HW | LOGD_WIFI, nm_log_dbg (LOGD_PLATFORM | LOGD_WIFI,
"(%s): NL80211_CMD_GET_WIPHY request indicated failure", "(%s): NL80211_CMD_GET_WIPHY request indicated failure",
nl80211->parent.iface); nl80211->parent.iface);
goto error; goto error;
} }
if (!device_info.supported) { if (!device_info.supported) {
nm_log_dbg (LOGD_HW | LOGD_WIFI, nm_log_dbg (LOGD_PLATFORM | LOGD_WIFI,
"(%s): driver does not fully support nl80211, falling back to WEXT", "(%s): driver does not fully support nl80211, falling back to WEXT",
nl80211->parent.iface); nl80211->parent.iface);
goto error; goto error;
} }
if (!device_info.can_scan_ssid) { if (!device_info.can_scan_ssid) {
nm_log_err (LOGD_HW | LOGD_WIFI, nm_log_err (LOGD_PLATFORM | LOGD_WIFI,
"(%s): driver does not support SSID scans", "(%s): driver does not support SSID scans",
nl80211->parent.iface); nl80211->parent.iface);
goto error; goto error;
} }
if (device_info.num_freqs == 0 || device_info.freqs == NULL) { if (device_info.num_freqs == 0 || device_info.freqs == NULL) {
nm_log_err (LOGD_HW | LOGD_WIFI, nm_log_err (LOGD_PLATFORM | LOGD_WIFI,
"(%s): driver reports no supported frequencies", "(%s): driver reports no supported frequencies",
nl80211->parent.iface); nl80211->parent.iface);
goto error; goto error;
} }
if (device_info.caps == 0) { if (device_info.caps == 0) {
nm_log_err (LOGD_HW | LOGD_WIFI, nm_log_err (LOGD_PLATFORM | LOGD_WIFI,
"(%s): driver doesn't report support of any encryption", "(%s): driver doesn't report support of any encryption",
nl80211->parent.iface); nl80211->parent.iface);
goto error; goto error;
@ -1120,7 +1120,7 @@ wifi_nl80211_init (const char *iface, int ifindex)
if (device_info.can_wowlan) if (device_info.can_wowlan)
nl80211->parent.get_wowlan = wifi_nl80211_get_wowlan; nl80211->parent.get_wowlan = wifi_nl80211_get_wowlan;
nm_log_info (LOGD_HW | LOGD_WIFI, nm_log_info (LOGD_PLATFORM | LOGD_WIFI,
"(%s): using nl80211 for WiFi device control", "(%s): using nl80211 for WiFi device control",
nl80211->parent.iface); nl80211->parent.iface);

View file

@ -105,7 +105,7 @@ wifi_wext_get_mode (WifiData *data)
if (ioctl (wext->fd, SIOCGIWMODE, &wrq) < 0) { if (ioctl (wext->fd, SIOCGIWMODE, &wrq) < 0) {
if (errno != ENODEV) { if (errno != ENODEV) {
nm_log_warn (LOGD_HW | LOGD_WIFI, nm_log_warn (LOGD_PLATFORM | LOGD_WIFI,
"(%s): error %d getting card mode", "(%s): error %d getting card mode",
wext->parent.iface, errno); wext->parent.iface, errno);
} }
@ -154,7 +154,7 @@ wifi_wext_set_mode (WifiData *data, const NM80211Mode mode)
nm_utils_ifname_cpy (wrq.ifr_name, wext->parent.iface); nm_utils_ifname_cpy (wrq.ifr_name, wext->parent.iface);
if (ioctl (wext->fd, SIOCSIWMODE, &wrq) < 0) { if (ioctl (wext->fd, SIOCSIWMODE, &wrq) < 0) {
if (errno != ENODEV) { if (errno != ENODEV) {
nm_log_err (LOGD_HW | LOGD_WIFI, "(%s): error setting mode %d", nm_log_err (LOGD_PLATFORM | LOGD_WIFI, "(%s): error setting mode %d",
wext->parent.iface, mode); wext->parent.iface, mode);
} }
return FALSE; return FALSE;
@ -178,7 +178,7 @@ wifi_wext_set_powersave (WifiData *data, guint32 powersave)
nm_utils_ifname_cpy (wrq.ifr_name, wext->parent.iface); nm_utils_ifname_cpy (wrq.ifr_name, wext->parent.iface);
if (ioctl (wext->fd, SIOCSIWPOWER, &wrq) < 0) { if (ioctl (wext->fd, SIOCSIWPOWER, &wrq) < 0) {
if (errno != ENODEV) { if (errno != ENODEV) {
nm_log_err (LOGD_HW | LOGD_WIFI, "(%s): error setting powersave %" G_GUINT32_FORMAT, nm_log_err (LOGD_PLATFORM | LOGD_WIFI, "(%s): error setting powersave %" G_GUINT32_FORMAT,
wext->parent.iface, powersave); wext->parent.iface, powersave);
} }
return FALSE; return FALSE;
@ -196,7 +196,7 @@ wifi_wext_get_freq (WifiData *data)
memset (&wrq, 0, sizeof (struct iwreq)); memset (&wrq, 0, sizeof (struct iwreq));
nm_utils_ifname_cpy (wrq.ifr_name, wext->parent.iface); nm_utils_ifname_cpy (wrq.ifr_name, wext->parent.iface);
if (ioctl (wext->fd, SIOCGIWFREQ, &wrq) < 0) { if (ioctl (wext->fd, SIOCGIWFREQ, &wrq) < 0) {
nm_log_warn (LOGD_HW | LOGD_WIFI, nm_log_warn (LOGD_PLATFORM | LOGD_WIFI,
"(%s): error getting frequency: %s", "(%s): error getting frequency: %s",
wext->parent.iface, strerror (errno)); wext->parent.iface, strerror (errno));
return 0; return 0;
@ -230,7 +230,7 @@ wifi_wext_get_bssid (WifiData *data, guint8 *out_bssid)
memset (&wrq, 0, sizeof (wrq)); memset (&wrq, 0, sizeof (wrq));
nm_utils_ifname_cpy (wrq.ifr_name, wext->parent.iface); nm_utils_ifname_cpy (wrq.ifr_name, wext->parent.iface);
if (ioctl (wext->fd, SIOCGIWAP, &wrq) < 0) { if (ioctl (wext->fd, SIOCGIWAP, &wrq) < 0) {
nm_log_warn (LOGD_HW | LOGD_WIFI, nm_log_warn (LOGD_PLATFORM | LOGD_WIFI,
"(%s): error getting associated BSSID: %s", "(%s): error getting associated BSSID: %s",
wext->parent.iface, strerror (errno)); wext->parent.iface, strerror (errno));
return FALSE; return FALSE;
@ -360,7 +360,7 @@ wifi_wext_get_qual (WifiData *data)
nm_utils_ifname_cpy (wrq.ifr_name, wext->parent.iface); nm_utils_ifname_cpy (wrq.ifr_name, wext->parent.iface);
if (ioctl (wext->fd, SIOCGIWSTATS, &wrq) < 0) { if (ioctl (wext->fd, SIOCGIWSTATS, &wrq) < 0) {
nm_log_warn (LOGD_HW | LOGD_WIFI, nm_log_warn (LOGD_PLATFORM | LOGD_WIFI,
"(%s): error getting signal strength: %s", "(%s): error getting signal strength: %s",
wext->parent.iface, strerror (errno)); wext->parent.iface, strerror (errno));
return -1; return -1;
@ -403,7 +403,7 @@ wifi_wext_set_mesh_channel (WifiData *data, guint32 channel)
} }
if (ioctl (wext->fd, SIOCSIWFREQ, &wrq) < 0) { if (ioctl (wext->fd, SIOCSIWFREQ, &wrq) < 0) {
nm_log_err (LOGD_HW | LOGD_WIFI | LOGD_OLPC, nm_log_err (LOGD_PLATFORM | LOGD_WIFI | LOGD_OLPC,
"(%s): error setting channel to %d: %s", "(%s): error setting channel to %d: %s",
wext->parent.iface, channel, strerror (errno)); wext->parent.iface, channel, strerror (errno));
return FALSE; return FALSE;
@ -431,7 +431,7 @@ wifi_wext_set_mesh_ssid (WifiData *data, const guint8 *ssid, gsize len)
return TRUE; return TRUE;
if (errno != ENODEV) { if (errno != ENODEV) {
nm_log_err (LOGD_HW | LOGD_WIFI | LOGD_OLPC, nm_log_err (LOGD_PLATFORM | LOGD_WIFI | LOGD_OLPC,
"(%s): error setting SSID to '%s': %s", "(%s): error setting SSID to '%s': %s",
wext->parent.iface, wext->parent.iface,
ssid ? nm_utils_escape_ssid (ssid, len) : "(null)", ssid ? nm_utils_escape_ssid (ssid, len) : "(null)",
@ -482,7 +482,7 @@ wext_get_range (WifiDataWext *wext,
success = TRUE; success = TRUE;
break; break;
} else if (errno != EAGAIN) { } else if (errno != EAGAIN) {
nm_log_err (LOGD_HW | LOGD_WIFI, nm_log_err (LOGD_PLATFORM | LOGD_WIFI,
"(%s): couldn't get driver range information (%d).", "(%s): couldn't get driver range information (%d).",
wext->parent.iface, errno); wext->parent.iface, errno);
break; break;
@ -492,7 +492,7 @@ wext_get_range (WifiDataWext *wext,
} }
if (i <= 0) { if (i <= 0) {
nm_log_warn (LOGD_HW | LOGD_WIFI, nm_log_warn (LOGD_PLATFORM | LOGD_WIFI,
"(%s): driver took too long to respond to IWRANGE query.", "(%s): driver took too long to respond to IWRANGE query.",
wext->parent.iface); wext->parent.iface);
} }
@ -583,13 +583,13 @@ wifi_wext_init (const char *iface, int ifindex, gboolean check_scan)
memset (&range, 0, sizeof (struct iw_range)); memset (&range, 0, sizeof (struct iw_range));
if (wext_get_range (wext, &range, &response_len) == FALSE) { if (wext_get_range (wext, &range, &response_len) == FALSE) {
nm_log_info (LOGD_HW | LOGD_WIFI, "(%s): driver WEXT range request failed", nm_log_info (LOGD_PLATFORM | LOGD_WIFI, "(%s): driver WEXT range request failed",
wext->parent.iface); wext->parent.iface);
goto error; goto error;
} }
if ((response_len < 300) || (range.we_version_compiled < 21)) { if ((response_len < 300) || (range.we_version_compiled < 21)) {
nm_log_info (LOGD_HW | LOGD_WIFI, nm_log_info (LOGD_PLATFORM | LOGD_WIFI,
"(%s): driver WEXT version too old (got %d, expected >= 21)", "(%s): driver WEXT version too old (got %d, expected >= 21)",
wext->parent.iface, wext->parent.iface,
range.we_version_compiled); range.we_version_compiled);
@ -613,7 +613,7 @@ wifi_wext_init (const char *iface, int ifindex, gboolean check_scan)
/* Check for scanning capability; cards that can't scan are not supported */ /* Check for scanning capability; cards that can't scan are not supported */
if (check_scan && (wext_can_scan (wext) == FALSE)) { if (check_scan && (wext_can_scan (wext) == FALSE)) {
nm_log_info (LOGD_HW | LOGD_WIFI, nm_log_info (LOGD_PLATFORM | LOGD_WIFI,
"(%s): drivers that cannot scan are unsupported", "(%s): drivers that cannot scan are unsupported",
wext->parent.iface); wext->parent.iface);
goto error; goto error;
@ -625,12 +625,12 @@ wifi_wext_init (const char *iface, int ifindex, gboolean check_scan)
*/ */
scan_capa_range = (struct iw_range_with_scan_capa *) &range; scan_capa_range = (struct iw_range_with_scan_capa *) &range;
if (scan_capa_range->scan_capa & NM_IW_SCAN_CAPA_ESSID) { if (scan_capa_range->scan_capa & NM_IW_SCAN_CAPA_ESSID) {
nm_log_info (LOGD_HW | LOGD_WIFI, nm_log_info (LOGD_PLATFORM | LOGD_WIFI,
"(%s): driver supports SSID scans (scan_capa 0x%02X).", "(%s): driver supports SSID scans (scan_capa 0x%02X).",
wext->parent.iface, wext->parent.iface,
scan_capa_range->scan_capa); scan_capa_range->scan_capa);
} else { } else {
nm_log_info (LOGD_HW | LOGD_WIFI, nm_log_info (LOGD_PLATFORM | LOGD_WIFI,
"(%s): driver does not support SSID scans (scan_capa 0x%02X).", "(%s): driver does not support SSID scans (scan_capa 0x%02X).",
wext->parent.iface, wext->parent.iface,
scan_capa_range->scan_capa); scan_capa_range->scan_capa);
@ -644,7 +644,7 @@ wifi_wext_init (const char *iface, int ifindex, gboolean check_scan)
if (has_5ghz) if (has_5ghz)
wext->parent.caps |= NM_WIFI_DEVICE_CAP_FREQ_5GHZ; wext->parent.caps |= NM_WIFI_DEVICE_CAP_FREQ_5GHZ;
nm_log_info (LOGD_HW | LOGD_WIFI, nm_log_info (LOGD_PLATFORM | LOGD_WIFI,
"(%s): using WEXT for WiFi device control", "(%s): using WEXT for WiFi device control",
wext->parent.iface); wext->parent.iface);