diff options
| author | Peter Lawrence <[email protected]> | 2020-03-03 10:31:46 -0600 |
|---|---|---|
| committer | Peter Lawrence <[email protected]> | 2020-03-03 10:31:46 -0600 |
| commit | 4a4682a80a2bd3d6d607d5a960443656de32955d (patch) | |
| tree | ef0fa610bdeb7e7509b73302962446520d283429 /src/class | |
| parent | fee79d746604f671483f5872337ea366f2d2c1a2 (diff) | |
update net class to follow API naming convention
Diffstat (limited to 'src/class')
| -rw-r--r-- | src/class/net/net_device.c | 16 | ||||
| -rw-r--r-- | src/class/net/net_device.h | 14 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/class/net/net_device.c b/src/class/net/net_device.c index 422d435c6..c918e5874 100644 --- a/src/class/net/net_device.c +++ b/src/class/net/net_device.c @@ -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; diff --git a/src/class/net/net_device.h b/src/class/net/net_device.h index c61efc86c..fee54163f 100644 --- a/src/class/net/net_device.h +++ b/src/class/net/net_device.h @@ -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 |
