update net class to follow API naming convention

This commit is contained in:
Peter Lawrence
2020-03-03 10:31:46 -06:00
parent fee79d7466
commit 4a4682a80a
5 changed files with 30 additions and 30 deletions

View File

@@ -74,7 +74,7 @@ CFG_TUSB_MEM_SECTION static netd_interface_t _netd_itf;
static bool can_xmit;
void network_recv_renew(void)
void tud_network_recv_renew(void)
{
usbd_edpt_xfer(TUD_OPT_RHPORT, _netd_itf.ep_out, received, sizeof(received));
}
@@ -156,13 +156,13 @@ bool netd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t
(*p_length) += 2*sizeof(tusb_desc_endpoint_t);
}
network_init_callback();
tud_network_init_cb();
// we are ready to transmit a packet
can_xmit = true;
// prepare for incoming packets
network_recv_renew();
tud_network_recv_renew();
return true;
}
@@ -237,7 +237,7 @@ static void handle_incoming_packet(uint32_t len)
if (hdr->bmType)
{
/* EEM Control Packet: discard it */
network_recv_renew();
tud_network_recv_renew();
}
else
{
@@ -256,13 +256,13 @@ static void handle_incoming_packet(uint32_t len)
{
memcpy(p->payload, pnt, size);
p->len = size;
accepted = network_recv_callback(p);
accepted = tud_network_recv_cb(p);
}
if (!p || !accepted)
{
/* if a buffer couldn't be allocated or accepted by the callback, we must discard this packet */
network_recv_renew();
tud_network_recv_renew();
}
}
}
@@ -297,12 +297,12 @@ bool netd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_
return true;
}
bool network_can_xmit(void)
bool tud_network_can_xmit(void)
{
return can_xmit;
}
void network_xmit(struct pbuf *p)
void tud_network_xmit(struct pbuf *p)
{
struct pbuf *q;
uint8_t *data;

View File

@@ -49,22 +49,22 @@
//--------------------------------------------------------------------+
// client must provide this: initialize any network state back to the beginning
void network_init_callback(void);
void tud_network_init_cb(void);
// client must provide this: return false if the packet buffer was not accepted
bool network_recv_callback(struct pbuf *p);
bool tud_network_recv_cb(struct pbuf *p);
// client must provide this: 48-bit MAC address
extern const uint8_t network_mac_address[6];
extern const uint8_t tud_network_mac_address[6];
// indicate to network driver that client has finished with the packet provided to network_recv_callback()
void network_recv_renew(void);
// indicate to network driver that client has finished with the packet provided to network_recv_cb()
void tud_network_recv_renew(void);
// poll network driver for its ability to accept another packet to transmit
bool network_can_xmit(void);
bool tud_network_can_xmit(void);
// if network_can_xmit() returns true, network_xmit() can be called once
void network_xmit(struct pbuf *p);
void tud_network_xmit(struct pbuf *p);
//--------------------------------------------------------------------+
// INTERNAL USBD-CLASS DRIVER API