Skip to content

Commit 80e8362

Browse files
committed
usb: device_next: usbd_cdc_ncm: correct net_if_carrier use
net_if_carrier is to be used independently of the administrative state (start and stop of the ethernet_api). This way it is no longer wrong. To really make use of it, net_if_carrier should be changed at the points where a connection is established or disconnected. But that is for later. Signed-off-by: Fin Maaß <[email protected]>
1 parent 7fb1fa2 commit 80e8362

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

subsys/usb/device_next/class/usbd_cdc_ncm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,6 @@ static int cdc_ncm_iface_start(const struct device *dev)
11231123
LOG_DBG("Start interface %d", net_if_get_by_iface(data->iface));
11241124

11251125
atomic_set_bit(&data->state, CDC_NCM_IFACE_UP);
1126-
net_if_carrier_on(data->iface);
11271126

11281127
if (atomic_test_bit(&data->state, CDC_NCM_DATA_IFACE_ENABLED)) {
11291128
(void)k_work_reschedule(&data->notif_work, K_MSEC(1));
@@ -1158,7 +1157,7 @@ static void cdc_ncm_iface_init(struct net_if *const iface)
11581157
sizeof(data->mac_addr),
11591158
NET_LINK_ETHERNET);
11601159

1161-
net_if_carrier_off(iface);
1160+
net_if_carrier_on(iface);
11621161

11631162
LOG_DBG("CDC NCM interface initialized");
11641163
}

0 commit comments

Comments
 (0)