/**************************************************************************//* *//* Copyright (c) Microsoft Corporation. All rights reserved. *//* *//* This software is licensed under the Microsoft Software License *//* Terms for Microsoft Azure RTOS. Full text of the license can be *//* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA *//* and in the root directory of this software. *//* */.../**************************************************************************/.../**************************************************************************//**************************************************************************//** *//** USBX Component *//** *//** USBX Network Driver for NETX 5.3 and above *//** */.../**************************************************************************//**************************************************************************/.../**************************************************************************//* *//* COMPONENT DEFINITION RELEASE *//* *//* ux_network_driver.h PORTABLE C *//* 6.1.8 *//* AUTHOR *//* *//* Chaoqiong Xiao, Microsoft Corporation *//* *//* DESCRIPTION *//* *//* This file contains all the header and extern functions used by the *//* USBX Network driver. *//* *//* RELEASE HISTORY *//* *//* DATE NAME DESCRIPTION *//* *//* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 *//* 09-30-2020 Chaoqiong Xiao Modified comment(s), *//* resulting in version 6.1 *//* 08-02-2021 Wen Wang Modified comment(s), *//* fixed spelling error, *//* added extern "C" keyword *//* for compatibility with C++, *//* resulting in version 6.1.8 *//* */.../**************************************************************************/#ifndefUX_NETWORK_DRIVER_H#defineUX_NETWORK_DRIVER_H/* Determine if a C++ compiler is being used. If so, ensure that standard C is used to process the API information. *//* ... */#ifdef__cplusplus/* Yes, C++ compiler is present. Use standard C. */extern"C"{#endif#include"tx_api.h"#include"nx_api.h"#defineUSB_NETWORK_DEVICE_MAX_INSTANCES8#defineUSB_NETWORK_DRIVER_SUCCESSUX_SUCCESS#defineUSB_NETWORK_DRIVER_FAILUREUX_ERROR#defineUSB_NETWORK_DEVICE_MAC_HEADER_SIZE14#defineNX_ETHERNET_SIZE14#defineNX_ETHERNET_ARP0x0806#defineNX_ETHERNET_RARP0x0835#defineNX_ETHERNET_IP0x0800#defineNX_ETHERNET_IPV60x08DD#defineNX_ETHERNET_MTU151410 definestypedefstructUSB_NETWORK_DEVICE_STRUCT{/* ip_instance is populated by NetX, as part of the interface attachment. */NX_IP*ux_network_device_ip_instance;/* interface_ptr is populated by NetX, as part of the interface attachment. */NX_INTERFACE*ux_network_device_interface_ptr;/* Define synchronization objects for deactivation. Note that these are only used if the activation/deactivation functions are not called under interrupt. *//* ... */UCHARux_network_device_activated_by_thread;TX_MUTEXux_network_device_deactivate_mutex;TX_SEMAPHOREux_network_device_deactivate_semaphore;UCHARux_network_device_deactivate_thread_waiting;UINTux_network_device_num_threads_inside;/* usb_instance is populated by USB instance activation. */VOID*ux_network_device_usb_instance_ptr;/* The write_function is populated by USB instance activation. */UINT(*ux_network_device_write_function)(VOID*ux_instance,NX_PACKET*packet_ptr);USHORTux_network_device_usb_link_up;USHORTux_network_device_link_status;ULONGux_network_physical_address_msw;ULONGux_network_physical_address_lsw;...}USB_NETWORK_DEVICE_TYPE;UINT_ux_network_driver_init(VOID);UINT_ux_network_driver_activate(VOID*ux_instance,UINT(*ux_network_device_write_function)(VOID*,NX_PACKET*),VOID**ux_network_handle,ULONGphysical_address_msw,ULONGphysical_address_lsw);UINT_ux_network_driver_deactivate(VOID*ux_instance,VOID*ux_network_handle);VOID_ux_network_driver_entry(NX_IP_DRIVER*nx_ip_driver);VOID_ux_network_driver_link_up(VOID*ux_network_handle);VOID_ux_network_driver_link_down(VOID*ux_network_handle);VOID_ux_network_driver_packet_received(VOID*ux_network_handle,NX_PACKET*packet_ptr);/* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. *//* ... */#ifdef__cplusplus}extern "C" { ... }#endif/* ... */...#endif
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.