Skip to content

Commit 4496e99

Browse files
finikorggalak
authored andcommitted
usb: netusb: rndis: Remove old unused code
Remove old unused code sending media status, sending this packet causes Windows problems although Linux works with it. Removing this code does not affect RNDIS functionality. Signed-off-by: Andrei Emeltchenko <[email protected]>
1 parent 276f50a commit 4496e99

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

subsys/usb/class/netusb/function_rndis.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ LOG_MODULE_REGISTER(usb_rndis);
1111
/* Enable verbose debug printing extra hexdumps */
1212
#define VERBOSE_DEBUG 0
1313

14-
/* Send media status */
15-
#define SEND_MEDIA_STATUS 0
16-
1714
#include <init.h>
1815

1916
#include <net/ethernet.h>
@@ -868,42 +865,6 @@ static int handle_encapsulated_cmd(u8_t *data, u32_t len)
868865
return 0;
869866
}
870867

871-
#if IS_ENABLED(SEND_MEDIA_STATUS)
872-
static int rndis_send_media_status(u32_t media_status)
873-
{
874-
struct rndis_media_status_indicate *ind;
875-
struct net_buf *buf;
876-
877-
LOG_DBG("status %u", media_status);
878-
879-
buf = net_buf_alloc(&rndis_tx_pool, K_NO_WAIT);
880-
if (!buf) {
881-
LOG_ERR("Cannot get free buffer");
882-
return -ENOMEM;
883-
}
884-
885-
ind = net_buf_add(buf, sizeof(*ind));
886-
ind->type = sys_cpu_to_le32(RNDIS_CMD_INDICATE);
887-
ind->len = sys_cpu_to_le32(sizeof(*ind));
888-
889-
if (media_status) {
890-
ind->status = sys_cpu_to_le32(RNDIS_STATUS_CONNECT_MEDIA);
891-
} else {
892-
ind->status = sys_cpu_to_le32(RNDIS_STATUS_DISCONNECT_MEDIA);
893-
}
894-
895-
ind->buf_len = 0U;
896-
ind->buf_offset = 0U;
897-
898-
rndis_queue_rsp(buf);
899-
900-
/* Nofity about ready reply */
901-
rndis_notify_rsp();
902-
903-
return 0;
904-
}
905-
#endif /* SEND_MEDIA_STATUS */
906-
907868
static int handle_encapsulated_rsp(u8_t **data, u32_t *len)
908869
{
909870
struct net_buf *buf;
@@ -1144,11 +1105,7 @@ static int rndis_connect_media(bool status)
11441105
rndis.media_status = RNDIS_OBJECT_ID_MEDIA_DISCONNECTED;
11451106
}
11461107

1147-
#if IS_ENABLED(SEND_MEDIA_STATUS)
1148-
return rndis_send_media_status(status);
1149-
#else
11501108
return 0;
1151-
#endif
11521109
}
11531110

11541111
static struct netusb_function rndis_function = {

0 commit comments

Comments
 (0)