core: replace 'master' with 'main'

This commit is contained in:
Aleksander Morgado
2021-11-04 22:50:00 +01:00
parent 9f679d4cac
commit e8ebd3af7e
8 changed files with 77 additions and 77 deletions
@@ -96,7 +96,7 @@ peek_port_qmi_for_data_ipa (MMBroadbandModemQmi *self,
{
MMPortQmi *found = NULL;
/* when using IPA, we have a master network interface that will be multiplexed
/* when using IPA, we have a main network interface that will be multiplexed
* to create link interfaces. We can assume any of the available QMI ports is
* able to manage that. */
+1 -1
View File
@@ -2020,7 +2020,7 @@ mm_base_modem_class_init (MMBaseModemClass *klass)
properties[PROP_DEVICE] =
g_param_spec_string (MM_BASE_MODEM_DEVICE,
"Device",
"Master modem parent device of all the modem's ports",
"Main modem parent device of all the modem's ports",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_property (object_class, PROP_DEVICE, properties[PROP_DEVICE]);
+9 -9
View File
@@ -201,7 +201,7 @@ typedef enum {
CONNECT_STEP_LOAD_PROFILE_SETTINGS,
CONNECT_STEP_PACKET_SERVICE,
CONNECT_STEP_SETUP_LINK,
CONNECT_STEP_SETUP_LINK_MASTER_UP,
CONNECT_STEP_SETUP_LINK_MAIN_UP,
CONNECT_STEP_CHECK_DISCONNECTED,
CONNECT_STEP_ENSURE_DISCONNECTED,
CONNECT_STEP_CONNECT,
@@ -725,9 +725,9 @@ check_disconnected_ready (MbimDevice *device,
}
static void
master_interface_up_ready (MMPortNet *link,
GAsyncResult *res,
GTask *task)
main_interface_up_ready (MMPortNet *link,
GAsyncResult *res,
GTask *task)
{
ConnectContext *ctx;
GError *error = NULL;
@@ -735,7 +735,7 @@ master_interface_up_ready (MMPortNet *link,
ctx = g_task_get_task_data (task);
if (!mm_port_net_link_setup_finish (link, res, &error)) {
g_prefix_error (&error, "Couldn't bring master interface up: ");
g_prefix_error (&error, "Couldn't bring main interface up: ");
g_task_return_error (task, error);
g_object_unref (task);
return;
@@ -1054,15 +1054,15 @@ connect_context_step (GTask *task)
ctx->step++;
/* fall through */
case CONNECT_STEP_SETUP_LINK_MASTER_UP:
/* if the connection is done through a new link, we need to ifup the master interface */
case CONNECT_STEP_SETUP_LINK_MAIN_UP:
/* if the connection is done through a new link, we need to ifup the main interface */
if (ctx->link) {
mm_obj_dbg (self, "bringing master interface %s up...", mm_port_get_device (ctx->data));
mm_obj_dbg (self, "bringing main interface %s up...", mm_port_get_device (ctx->data));
mm_port_net_link_setup (MM_PORT_NET (ctx->data),
TRUE,
0, /* ignore */
g_task_get_cancellable (task),
(GAsyncReadyCallback) master_interface_up_ready,
(GAsyncReadyCallback) main_interface_up_ready,
task);
return;
}
+10 -10
View File
@@ -425,7 +425,7 @@ load_connection_status (MMBaseBearer *_self,
/* Connection status polling is an optional feature that must be
* enabled explicitly via udev tags. If not set, out as unsupported.
* Note that when connected via a muxed link, the udev tag should be
* checked on the master interface (lower device) */
* checked on the main interface (lower device) */
if ((self->priv->data &&
!mm_kernel_device_get_global_property_as_boolean (mm_port_peek_kernel_device (self->priv->data),
"ID_MM_QMI_CONNECTION_STATUS_POLLING_ENABLE")) ||
@@ -467,7 +467,7 @@ typedef enum {
CONNECT_STEP_OPEN_QMI_PORT,
CONNECT_STEP_SETUP_DATA_FORMAT,
CONNECT_STEP_SETUP_LINK,
CONNECT_STEP_SETUP_LINK_MASTER_UP,
CONNECT_STEP_SETUP_LINK_MAIN_UP,
CONNECT_STEP_IP_METHOD,
CONNECT_STEP_IPV4,
CONNECT_STEP_WDS_CLIENT_IPV4,
@@ -1436,9 +1436,9 @@ qmi_port_allocate_client_ready (MMPortQmi *qmi,
}
static void
master_interface_up_ready (MMPortNet *link,
GAsyncResult *res,
GTask *task)
main_interface_up_ready (MMPortNet *link,
GAsyncResult *res,
GTask *task)
{
ConnectContext *ctx;
GError *error = NULL;
@@ -1446,7 +1446,7 @@ master_interface_up_ready (MMPortNet *link,
ctx = g_task_get_task_data (task);
if (!mm_port_net_link_setup_finish (link, res, &error)) {
g_prefix_error (&error, "Couldn't bring master interface up: ");
g_prefix_error (&error, "Couldn't bring main interface up: ");
complete_connect (task, NULL, error);
return;
}
@@ -1743,15 +1743,15 @@ connect_context_step (GTask *task)
ctx->step++;
/* fall through */
case CONNECT_STEP_SETUP_LINK_MASTER_UP:
/* if the connection is done through a new link, we need to ifup the master interface */
case CONNECT_STEP_SETUP_LINK_MAIN_UP:
/* if the connection is done through a new link, we need to ifup the main interface */
if (ctx->link) {
mm_obj_dbg (self, "bringing master interface %s up...", mm_port_get_device (ctx->data));
mm_obj_dbg (self, "bringing main interface %s up...", mm_port_get_device (ctx->data));
mm_port_net_link_setup (MM_PORT_NET (ctx->data),
TRUE,
0, /* ignore */
g_task_get_cancellable (task),
(GAsyncReadyCallback) master_interface_up_ready,
(GAsyncReadyCallback) main_interface_up_ready,
task);
return;
}
+1 -1
View File
@@ -2202,7 +2202,7 @@ modem_create_bearer (MMIfaceModem *self,
/* Note: the session id to be used by the bearer will always be 0
* for non-multiplexed sessions, bound to the non-VLAN-tagged traffic
* managed by the master network interface */
* managed by the main network interface */
task = g_task_new (self, NULL, callback, user_data);
mm_obj_dbg (self, "creating MBIM bearer in MBIM modem");
+39 -39
View File
@@ -76,7 +76,7 @@ struct _MMPortQmiPrivate {
QmiWdaDataAggregationProtocol dap;
guint max_multiplexed_links;
/* preallocated links */
MMPort *preallocated_links_master;
MMPort *preallocated_links_main;
GArray *preallocated_links;
GList *preallocated_links_setup_pending;
};
@@ -325,7 +325,7 @@ delete_preallocated_links (QmiDevice *qmi_device,
{
guint i;
/* This link deletion cleanup may fail if the master interface is up
/* This link deletion cleanup may fail if the main interface is up
* (a limitation of qmi_wwan in some kernel versions). It's just a minor
* inconvenience really, if MM restarts they'll be all removed during
* initialization anyway */
@@ -382,7 +382,7 @@ release_preallocated_link (MMPortQmi *self,
static gboolean
acquire_preallocated_link (MMPortQmi *self,
MMPort *master,
MMPort *main,
gchar **link_name,
guint *mux_id,
GError **error)
@@ -395,18 +395,18 @@ acquire_preallocated_link (MMPortQmi *self,
return FALSE;
}
if (!self->priv->preallocated_links || !self->priv->preallocated_links_master) {
if (!self->priv->preallocated_links || !self->priv->preallocated_links_main) {
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
"No preallocated links available");
return FALSE;
}
if ((master != self->priv->preallocated_links_master) &&
(g_strcmp0 (mm_port_get_device (master), mm_port_get_device (self->priv->preallocated_links_master)) != 0)) {
if ((main != self->priv->preallocated_links_main) &&
(g_strcmp0 (mm_port_get_device (main), mm_port_get_device (self->priv->preallocated_links_main)) != 0)) {
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
"Preallocated links available in 'net/%s', not in 'net/%s'",
mm_port_get_device (self->priv->preallocated_links_master),
mm_port_get_device (master));
mm_port_get_device (self->priv->preallocated_links_main),
mm_port_get_device (main));
return FALSE;
}
@@ -524,7 +524,7 @@ initialize_preallocated_links (MMPortQmi *self,
ctx = g_slice_new0 (InitializePreallocatedLinksContext);
ctx->qmi_device = g_object_ref (self->priv->qmi_device);
ctx->data = g_object_ref (self->priv->preallocated_links_master);
ctx->data = g_object_ref (self->priv->preallocated_links_main);
ctx->preallocated_links = g_array_sized_new (FALSE, FALSE, sizeof (PreallocatedLinkInfo), DEFAULT_LINK_PREALLOCATED_AMOUNT);
g_array_set_clear_func (ctx->preallocated_links, (GDestroyNotify)preallocated_link_info_clear);
g_task_set_task_data (task, ctx, (GDestroyNotify)initialize_preallocated_links_context_free);
@@ -535,7 +535,7 @@ initialize_preallocated_links (MMPortQmi *self,
/*****************************************************************************/
typedef struct {
MMPort *master;
MMPort *main;
gchar *link_name;
guint mux_id;
} SetupLinkContext;
@@ -544,7 +544,7 @@ static void
setup_link_context_free (SetupLinkContext *ctx)
{
g_free (ctx->link_name);
g_clear_object (&ctx->master);
g_clear_object (&ctx->main);
g_slice_free (SetupLinkContext, ctx);
}
@@ -594,7 +594,7 @@ setup_preallocated_link (GTask *task)
self = g_task_get_source_object (task);
ctx = g_task_get_task_data (task);
if (!acquire_preallocated_link (self, ctx->master, &ctx->link_name, &ctx->mux_id, &error))
if (!acquire_preallocated_link (self, ctx->main, &ctx->link_name, &ctx->mux_id, &error))
g_task_return_error (task, error);
else
g_task_return_boolean (task, TRUE);
@@ -620,8 +620,8 @@ initialize_preallocated_links_ready (MMPortQmi *self,
self->priv->preallocated_links_setup_pending = g_list_delete_link (self->priv->preallocated_links_setup_pending,
self->priv->preallocated_links_setup_pending);
}
/* and reset back the master, because we're not really initialized */
g_clear_object (&self->priv->preallocated_links_master);
/* and reset back the main, because we're not really initialized */
g_clear_object (&self->priv->preallocated_links_main);
return;
}
@@ -665,7 +665,7 @@ mm_port_qmi_setup_link (MMPortQmi *self,
}
ctx = g_slice_new0 (SetupLinkContext);
ctx->master = g_object_ref (data);
ctx->main = g_object_ref (data);
ctx->mux_id = QMI_DEVICE_MUX_ID_UNBOUND;
g_task_set_task_data (task, ctx, (GDestroyNotify) setup_link_context_free);
@@ -703,15 +703,15 @@ mm_port_qmi_setup_link (MMPortQmi *self,
/* We must make sure we don't run this procedure in parallel (e.g. if multiple
* connection attempts reach at the same time), so if we're told the preallocated
* links are already being initialized (master is set) but the array didn't exist,
* links are already being initialized (main is set) but the array didn't exist,
* queue our task for completion once we're fully initialized */
if (self->priv->preallocated_links_master) {
if (self->priv->preallocated_links_main) {
self->priv->preallocated_links_setup_pending = g_list_append (self->priv->preallocated_links_setup_pending, task);
return;
}
/* Store master to flag that we're initializing preallocated links */
self->priv->preallocated_links_master = g_object_ref (data);
/* Store main to flag that we're initializing preallocated links */
self->priv->preallocated_links_main = g_object_ref (data);
initialize_preallocated_links (self,
(GAsyncReadyCallback) initialize_preallocated_links_ready,
task);
@@ -900,7 +900,7 @@ internal_reset (MMPortQmi *self,
ctx->device = g_object_ref (device);
g_task_set_task_data (task, ctx, (GDestroyNotify) internal_reset_context_free);
/* first, bring down master interface */
/* first, bring down main interface */
mm_obj_dbg (self, "bringing down data interface '%s'",
mm_port_get_device (ctx->data));
mm_port_net_link_setup (MM_PORT_NET (ctx->data),
@@ -1140,7 +1140,7 @@ typedef enum {
INTERNAL_SETUP_DATA_FORMAT_STEP_QUERY_DONE,
INTERNAL_SETUP_DATA_FORMAT_STEP_CHECK_DATA_FORMAT_COMBINATION,
INTERNAL_SETUP_DATA_FORMAT_STEP_SYNC_WDA_DATA_FORMAT,
INTERNAL_SETUP_DATA_FORMAT_STEP_SETUP_MASTER_MTU,
INTERNAL_SETUP_DATA_FORMAT_STEP_SETUP_MAIN_MTU,
INTERNAL_SETUP_DATA_FORMAT_STEP_SYNC_KERNEL_DATA_MODE,
INTERNAL_SETUP_DATA_FORMAT_STEP_LAST,
} InternalSetupDataFormatStep;
@@ -1288,9 +1288,9 @@ sync_kernel_data_mode (GTask *task)
}
static void
master_mtu_ready (MMPortNet *data,
GAsyncResult *res,
GTask *task)
main_mtu_ready (MMPortNet *data,
GAsyncResult *res,
GTask *task)
{
MMPortQmi *self;
InternalSetupDataFormatContext *ctx;
@@ -1300,7 +1300,7 @@ master_mtu_ready (MMPortNet *data,
ctx = g_task_get_task_data (task);
if (!mm_port_net_link_setup_finish (data, res, &error)) {
mm_obj_dbg (self, "failed to setup master MTU: %s", error->message);
mm_obj_dbg (self, "failed to setup main MTU: %s", error->message);
g_clear_error (&error);
}
@@ -1310,7 +1310,7 @@ master_mtu_ready (MMPortNet *data,
}
static void
setup_master_mtu (GTask *task)
setup_main_mtu (GTask *task)
{
MMPortQmi *self;
InternalSetupDataFormatContext *ctx;
@@ -1320,7 +1320,7 @@ setup_master_mtu (GTask *task)
self = g_task_get_source_object (task);
ctx = g_task_get_task_data (task);
/* qmi_wwan multiplexing logic requires master mtu set to the maximum data
/* qmi_wwan multiplexing logic requires main mtu set to the maximum data
* aggregation size */
if (ctx->kernel_data_modes_requested & (MM_PORT_QMI_KERNEL_DATA_MODE_MUX_RMNET | MM_PORT_QMI_KERNEL_DATA_MODE_MUX_QMIWWAN)) {
/* Load current max datagram size supported */
@@ -1335,18 +1335,18 @@ setup_master_mtu (GTask *task)
/* If no max aggregation size was specified by the modem (e.g. if we requested QMAP
* aggregation protocol but the modem doesn't support it), skip */
if (!mtu) {
mm_obj_dbg (self, "ignoring master mtu setup");
mm_obj_dbg (self, "ignoring main mtu setup");
ctx->step++;
internal_setup_data_format_context_step (task);
return;
}
}
/* Master MTU change can only be changed while in 802-3 */
/* Main MTU change can only be changed while in 802-3 */
if (!(ctx->kernel_data_modes_current & MM_PORT_QMI_KERNEL_DATA_MODE_802_3)) {
mm_obj_dbg (self, "Updating kernel expected data format to 802-3 temporarily for master mtu setup");
mm_obj_dbg (self, "Updating kernel expected data format to 802-3 temporarily for main mtu setup");
if (!qmi_device_set_expected_data_format (ctx->device, QMI_DEVICE_EXPECTED_DATA_FORMAT_802_3, &error)) {
g_prefix_error (&error, "Failed setting up 802.3 kernel data format before master mtu change: ");
g_prefix_error (&error, "Failed setting up 802.3 kernel data format before main mtu change: ");
g_task_return_error (task, error);
g_object_unref (task);
return;
@@ -1355,12 +1355,12 @@ setup_master_mtu (GTask *task)
ctx->kernel_data_modes_current = MM_PORT_QMI_KERNEL_DATA_MODE_802_3;
}
mm_obj_dbg (self, "setting up master mtu: %u bytes", mtu);
mm_obj_dbg (self, "setting up main mtu: %u bytes", mtu);
mm_port_net_link_setup (MM_PORT_NET (ctx->data),
FALSE,
mtu,
NULL,
(GAsyncReadyCallback) master_mtu_ready,
(GAsyncReadyCallback) main_mtu_ready,
task);
}
@@ -1382,7 +1382,7 @@ set_data_format_ready (QmiClientWda *client,
return;
}
/* store max aggregation size so that the master MTU logic works */
/* store max aggregation size so that the main MTU logic works */
qmi_message_wda_set_data_format_output_get_downlink_data_aggregation_max_size (output, &ctx->wda_dl_dap_max_size_current, NULL);
/* request reload */
@@ -1849,11 +1849,11 @@ internal_setup_data_format_context_step (GTask *task)
ctx->step++;
/* Fall through */
case INTERNAL_SETUP_DATA_FORMAT_STEP_SETUP_MASTER_MTU:
/* qmi_wwan add_mux/del_mux based logic requires master MTU set to the maximum
case INTERNAL_SETUP_DATA_FORMAT_STEP_SETUP_MAIN_MTU:
/* qmi_wwan add_mux/del_mux based logic requires main MTU set to the maximum
* data aggregation size reported by the modem. */
if (g_strcmp0 (self->priv->net_driver, "qmi_wwan") == 0) {
setup_master_mtu (task);
setup_main_mtu (task);
return;
}
ctx->step++;
@@ -2648,7 +2648,7 @@ mm_port_qmi_close (MMPortQmi *self,
delete_preallocated_links (ctx->qmi_device, self->priv->preallocated_links);
g_clear_pointer (&self->priv->preallocated_links, g_array_unref);
}
g_clear_object (&self->priv->preallocated_links_master);
g_clear_object (&self->priv->preallocated_links_main);
qmi_device_close_async (ctx->qmi_device,
5,
@@ -2762,7 +2762,7 @@ dispose (GObject *object)
if (self->priv->preallocated_links && self->priv->qmi_device)
delete_preallocated_links (self->priv->qmi_device, self->priv->preallocated_links);
g_clear_pointer (&self->priv->preallocated_links, g_array_unref);
g_clear_object (&self->priv->preallocated_links_master);
g_clear_object (&self->priv->preallocated_links_main);
/* Clear node object */
#if defined WITH_QRTR
+2 -2
View File
@@ -28,9 +28,9 @@
typedef enum { /*< underscore_name=mm_port_qmi_kernel_data_mode >*/
MM_PORT_QMI_KERNEL_DATA_MODE_NONE = 0,
/* ethernet packets over the master network interface */
/* ethernet packets over the main network interface */
MM_PORT_QMI_KERNEL_DATA_MODE_802_3 = 1 << 0,
/* raw-ip packets over the master network interface */
/* raw-ip packets over the main network interface */
MM_PORT_QMI_KERNEL_DATA_MODE_RAW_IP = 1 << 1,
/* multiplexing support setup with rmnet */
MM_PORT_QMI_KERNEL_DATA_MODE_MUX_RMNET = 1 << 2,
+14 -14
View File
@@ -37,7 +37,7 @@
#include "mm-log-test.h"
typedef struct {
int master;
int main;
int slave;
gboolean valid;
pid_t child;
@@ -259,11 +259,11 @@ test_verinfo (TestData *d)
/* Parent */
d->child = cpid;
req_len = server_wait_request (d->master, req, sizeof (req));
req_len = server_wait_request (d->main, req, sizeof (req));
g_assert (req_len == 1);
g_assert_cmpint (req[0], ==, 0x00);
server_send_response (d->master, rsp, sizeof (rsp));
server_send_response (d->main, rsp, sizeof (rsp));
g_assert (wait_for_child (d, 3));
}
@@ -311,11 +311,11 @@ test_sierra_cns_rejected (TestData *d)
/* Parent */
d->child = cpid;
req_len = server_wait_request (d->master, req, sizeof (req));
req_len = server_wait_request (d->main, req, sizeof (req));
g_assert (req_len == 1);
g_assert_cmpint (req[0], ==, 0x00);
server_send_response (d->master, rsp, sizeof (rsp));
server_send_response (d->main, rsp, sizeof (rsp));
/* We expect the child to exit normally */
g_assert (wait_for_child (d, 3));
@@ -347,11 +347,11 @@ test_random_data_rejected (TestData *d)
/* Parent */
d->child = cpid;
req_len = server_wait_request (d->master, req, sizeof (req));
req_len = server_wait_request (d->main, req, sizeof (req));
g_assert (req_len == 1);
g_assert_cmpint (req[0], ==, 0x00);
server_send_response (d->master, rsp, sizeof (rsp));
server_send_response (d->main, rsp, sizeof (rsp));
/* We expect the child to exit normally */
g_assert (wait_for_child (d, 3));
@@ -387,11 +387,11 @@ test_leading_frame_markers (TestData *d)
/* Parent */
d->child = cpid;
req_len = server_wait_request (d->master, req, sizeof (req));
req_len = server_wait_request (d->main, req, sizeof (req));
g_assert (req_len == 1);
g_assert_cmpint (req[0], ==, 0x00);
server_send_response (d->master, rsp, sizeof (rsp));
server_send_response (d->main, rsp, sizeof (rsp));
/* We expect the child to exit normally */
g_assert (wait_for_child (d, 3));
@@ -403,7 +403,7 @@ test_pty_create (TestData *d)
struct termios stbuf;
int ret, err;
ret = openpty (&d->master, &d->slave, NULL, NULL, NULL);
ret = openpty (&d->main, &d->slave, NULL, NULL, NULL);
g_assert (ret == 0);
d->valid = TRUE;
@@ -415,8 +415,8 @@ test_pty_create (TestData *d)
tcsetattr (d->slave, TCSANOW, &stbuf);
fcntl (d->slave, F_SETFL, O_NONBLOCK);
fcntl (d->master, F_SETFL, O_NONBLOCK);
err = qcdm_port_setup (d->master);
fcntl (d->main, F_SETFL, O_NONBLOCK);
err = qcdm_port_setup (d->main);
g_assert_cmpint (err, ==, QCDM_SUCCESS);
}
@@ -429,8 +429,8 @@ test_pty_cleanup (TestData *d)
if (d->valid) {
if (d->child)
kill (d->child, SIGKILL);
if (d->master >= 0)
close (d->master);
if (d->main >= 0)
close (d->main);
if (d->slave >= 0)
close (d->slave);
memset (d, 0, sizeof (*d));