summaryrefslogtreecommitdiff
path: root/src/class/net/ncm_device.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-06-02 16:51:17 +0700
committerhathach <[email protected]>2022-06-02 16:51:17 +0700
commit8b9cf152a0dedda573fb3374d8c873dce4b883d1 (patch)
tree1e6236685627b6fdd960e70da54e89aa37fe9fb1 /src/class/net/ncm_device.c
parent99c1585ed215cb5ee2e27a41c54310d144e0ee6c (diff)
rhport argument in usbd_ API() is not used (always use the initialized port)
remove the usage of TUD_OPT_RHPORT in class driver
Diffstat (limited to 'src/class/net/ncm_device.c')
-rw-r--r--src/class/net/ncm_device.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/class/net/ncm_device.c b/src/class/net/ncm_device.c
index 1987337f8..00892b49c 100644
--- a/src/class/net/ncm_device.c
+++ b/src/class/net/ncm_device.c
@@ -188,7 +188,7 @@ static void ncm_start_tx(void) {
ntb->ndp.datagram[ncm_interface.datagram_count].wDatagramLength = 0;
// Kick off an endpoint transfer
- usbd_edpt_xfer(TUD_OPT_RHPORT, ncm_interface.ep_in, ntb->data, ntb_length);
+ usbd_edpt_xfer(0, ncm_interface.ep_in, ntb->data, ntb_length);
ncm_interface.transferring = true;
// Swap to the other NTB and clear it out
@@ -229,7 +229,7 @@ void tud_network_recv_renew(void)
{
if (!ncm_interface.num_datagrams)
{
- usbd_edpt_xfer(TUD_OPT_RHPORT, ncm_interface.ep_out, receive_ntb, sizeof(receive_ntb));
+ usbd_edpt_xfer(0, ncm_interface.ep_out, receive_ntb, sizeof(receive_ntb));
return;
}
@@ -316,14 +316,15 @@ uint16_t netd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint1
static void ncm_report(void)
{
+ uint8_t const rhport = 0;
if (ncm_interface.report_state == REPORT_SPEED) {
ncm_notify_speed_change.header.wIndex = ncm_interface.itf_num;
- usbd_edpt_xfer(TUD_OPT_RHPORT, ncm_interface.ep_notif, (uint8_t *) &ncm_notify_speed_change, sizeof(ncm_notify_speed_change));
+ usbd_edpt_xfer(rhport, ncm_interface.ep_notif, (uint8_t *) &ncm_notify_speed_change, sizeof(ncm_notify_speed_change));
ncm_interface.report_state = REPORT_CONNECTED;
ncm_interface.report_pending = true;
} else if (ncm_interface.report_state == REPORT_CONNECTED) {
ncm_notify_connected.header.wIndex = ncm_interface.itf_num;
- usbd_edpt_xfer(TUD_OPT_RHPORT, ncm_interface.ep_notif, (uint8_t *) &ncm_notify_connected, sizeof(ncm_notify_connected));
+ usbd_edpt_xfer(rhport, ncm_interface.ep_notif, (uint8_t *) &ncm_notify_connected, sizeof(ncm_notify_connected));
ncm_interface.report_state = REPORT_DONE;
ncm_interface.report_pending = true;
}