NetBurner 3.5.7
PDF Version
ueue/src/ncm_interface.h
1
11#ifndef __NCM_INTERFACE_H
12#define __NCM_INTERFACE_H
13
14#ifdef SOMRT1061
15#include <nettypes.h>
16#include <netinterface.h>
17
18// Forward declarations
19class dCDC_NCM;
20
29class NcmInterfaceBlock : public EtherLikeInterface
30{
31private:
32 dCDC_NCM *pNcmDevice;
33 bool linkActive;
34 int speedMbps;
35
36public:
42 NcmInterfaceBlock(const char *name, dCDC_NCM *pDevice);
43
49
54 virtual void send_func(PoolPtr poolPtr) override;
55
61 virtual void EnableMulticast(MACADR macAddress, BOOL addAddress) override;
62
67 virtual bool LinkActive() override;
68
73 virtual int LinkSpeed() override;
74
79 void SetLinkSpeed(int speed);
80
85 virtual bool LinkDuplex() override;
86
91 void SetMACAddress(const MACADR &mac);
92
97 virtual bool bNeedsArp() override;
98
103 dCDC_NCM *GetNcmDevice() { return pNcmDevice; }
104};
105
106/*******************************************************************************
107 * Interface Registration Functions
108 ******************************************************************************/
109
115NcmInterfaceBlock *RegisterNcmInterface1(const MACADR &mac);
116
122NcmInterfaceBlock *RegisterNcmInterface2(const MACADR &mac);
123
128NcmInterfaceBlock *GetNcmInterface1();
129
134NcmInterfaceBlock *GetNcmInterface2();
135
140int StartNcmTask();
141
145void StopNcmTask();
146
158NcmInterfaceBlock *InitializeNcmWithNetwork(int usbPort, const MACADR &mac);
159
160#endif /* SOMRT1061 */
161#endif /* __NCM_INTERFACE_H */
Used to store and manipulate MAC addresses.
Definition nettypes.h:69
Network interface block for NCM USB device.
Definition src/ncm_interface.h:30
virtual void send_func(PoolPtr poolPtr) override
Send function - called by network stack to transmit.
void LinkToDevice()
Register interface and link to NCM device Called after RegisterInterface() to update the device with ...
virtual int LinkSpeed() override
Returns link speed in Mbps.
virtual void EnableMulticast(MACADR macAddress, BOOL addAddress) override
Enable or disable multicast address reception.
void SetLinkSpeed(int speed)
Set the link speed.
virtual bool bNeedsArp() override
Check if this interface needs ARP.
virtual bool LinkActive() override
Returns current link status.
NcmInterfaceBlock(const char *name, dCDC_NCM *pDevice)
Constructor.
void SetMACAddress(const MACADR &mac)
Set the MAC address for this interface.
virtual bool LinkDuplex() override
Returns duplex mode.
dCDC_NCM * GetNcmDevice()
Get the associated NCM device.
Definition ueue/src/ncm_interface.h:103
USB CDC NCM Device Class for Ethernet-over-USB.
Definition src/usbd_cdc_ncm.h:63
Main buffer structure for network and serial communication.
Definition buffers.h:90