mostly comments
This commit is contained in:
@@ -129,6 +129,18 @@ CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN tu_static const ntb_parameters_t ntb_par
|
|||||||
.wNtbOutMaxDatagrams = CFG_TUD_NCM_OUT_MAX_DATAGRAMS_PER_NTB,
|
.wNtbOutMaxDatagrams = CFG_TUD_NCM_OUT_MAX_DATAGRAMS_PER_NTB,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Some confusing remarks about wNtbOutMaxDatagrams...
|
||||||
|
// ==1 -> SystemView packets/s goes up to 2000 and events are lost during startup
|
||||||
|
// ==0 -> SystemView runs fine, iperf shows in wireshark a lot of error
|
||||||
|
// ==6 -> SystemView runs fine, iperf also
|
||||||
|
// >6 -> iperf starts to show errors
|
||||||
|
// -> 6 seems to be the best value. Why? Don't know, perhaps only on my system?
|
||||||
|
// switch \a TU_LOG2 on to see interesting values for this.
|
||||||
|
//
|
||||||
|
// iperf: for MSS in 100 200 400 800 1200 1450 1500; do iperf -c 192.168.14.1 -e -i 1 -M $MSS -l 8192 -P 1; sleep 2; done
|
||||||
|
// sysview: SYSTICKS_PER_SEC=35000, IDLE_US=1000, PRINT_MOD=1000
|
||||||
|
//
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// everything about notifications
|
// everything about notifications
|
||||||
@@ -340,7 +352,7 @@ static void xmit_start_if_possible(uint8_t rhport)
|
|||||||
ncm_interface.xmit_glue_ntb = NULL;
|
ncm_interface.xmit_glue_ntb = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_OUT_ENABLED
|
#if CFG_TUSB_DEBUG >= 3
|
||||||
{
|
{
|
||||||
uint16_t len = ncm_interface.xmit_tinyusb_ntb->nth.wBlockLength;
|
uint16_t len = ncm_interface.xmit_tinyusb_ntb->nth.wBlockLength;
|
||||||
TU_LOG3(" %d\n", len);
|
TU_LOG3(" %d\n", len);
|
||||||
@@ -708,7 +720,7 @@ bool tud_network_can_xmit(uint16_t size)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
xmit_start_if_possible(ncm_interface.rhport);
|
xmit_start_if_possible(ncm_interface.rhport);
|
||||||
TU_LOG2("tud_network_can_xmit: request blocked\n"); // could happen if all xmit buffers are full (but should happen rarely)
|
TU_LOG2("(II) tud_network_can_xmit: request blocked\n"); // could happen if all xmit buffers are full (but should happen rarely)
|
||||||
return false;
|
return false;
|
||||||
} // tud_network_can_xmit
|
} // tud_network_can_xmit
|
||||||
|
|
||||||
@@ -796,10 +808,18 @@ void netd_init(void)
|
|||||||
}
|
}
|
||||||
} // netd_init
|
} // netd_init
|
||||||
|
|
||||||
bool netd_deinit(void) {
|
|
||||||
|
|
||||||
|
bool netd_deinit(void)
|
||||||
|
/**
|
||||||
|
* Deinit driver
|
||||||
|
*/
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void netd_reset(uint8_t rhport)
|
void netd_reset(uint8_t rhport)
|
||||||
/**
|
/**
|
||||||
* Resets the port.
|
* Resets the port.
|
||||||
@@ -947,7 +967,9 @@ bool netd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (request->bmRequestType_bit.type) {
|
switch (request->bmRequestType_bit.type) {
|
||||||
case TUSB_REQ_TYPE_STANDARD: {
|
case TUSB_REQ_TYPE_STANDARD:
|
||||||
|
TU_LOG3(" TUSB_REQ_TYPE_STANDARD: %d\n", request->bRequest);
|
||||||
|
|
||||||
switch (request->bRequest) {
|
switch (request->bRequest) {
|
||||||
case TUSB_REQ_GET_INTERFACE: {
|
case TUSB_REQ_GET_INTERFACE: {
|
||||||
TU_VERIFY(ncm_interface.itf_num + 1 == request->wIndex, false);
|
TU_VERIFY(ncm_interface.itf_num + 1 == request->wIndex, false);
|
||||||
@@ -975,15 +997,14 @@ bool netd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t
|
|||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TUSB_REQ_TYPE_CLASS: {
|
case TUSB_REQ_TYPE_CLASS:
|
||||||
TU_VERIFY(ncm_interface.itf_num == request->wIndex, false);
|
TU_VERIFY(ncm_interface.itf_num == request->wIndex, false);
|
||||||
switch (request->bRequest) {
|
|
||||||
TU_LOG3(" TUSB_REQ_TYPE_CLASS: %d\n", request->bRequest);
|
TU_LOG3(" TUSB_REQ_TYPE_CLASS: %d\n", request->bRequest);
|
||||||
|
|
||||||
case NCM_GET_NTB_PARAMETERS: {
|
if (request->bRequest == NCM_GET_NTB_PARAMETERS) {
|
||||||
// transfer NTB parameters to host.
|
// transfer NTB parameters to host.
|
||||||
// TODO can one assume, that tud_control_xfer() succeeds?
|
// TODO can one assume, that tud_control_xfer() succeeds?
|
||||||
TU_LOG3(" NCM_GET_NTB_PARAMETERS\n");
|
TU_LOG3(" NCM_GET_NTB_PARAMETERS\n");
|
||||||
@@ -994,13 +1015,6 @@ bool netd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t
|
|||||||
// unsupported request
|
// unsupported request
|
||||||
default:
|
default:
|
||||||
return false ;
|
return false ;
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
// unsupported request
|
|
||||||
default:
|
|
||||||
return false ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user